May 2010 Archives

Monday, 2010-05-31 16:04 MDT

Shutting Down USB Drives

While mucking with three new Seagate FreeAgent GoFlex one terabyte external 2.5" drives, I noticed that Gnome has up to three options for what to do with a drive when you want to disconnect it. They are:

  • Unmount
  • Eject, and
  • Safely Remove Drive

There's a brief summary of the three options in The "Unmount", "Eject" and "Safely Remove Drive" dilemma. "Unmount" I can figure out. "Eject" is obvious. OK, but what's this last one? It suggests that there is an unsafe way to remove a drive. And there is: just pull the plug on it without first unmounting any mounted partitions. That's a good way to leave the file system a mess. Don't do it.

What the last one actually does is tell the external device to spin down the drive, which implies flushing its internal buffers. In short, it does a graceful shutdown. Then it is safe to unplug and remove the drive. This becomes important with drives that get their power from the USB port, not from a separate power supply.

That sounds very nice. Except that my backup server (where I'll be using these things for offsite backups) doesn't run a GUI. In fact I run it headless and do everything by command line over SSH. So I wondered what the command line equivalent was.

Of course this is Linux: there are multiple answers. On Ubuntu 9.10 Komic Koala, the answer is devkit-disks --detach /dev/sdX, which indeed spins down and shuts off the device. Unfortunately devkit isn't available for Ubuntu 8.04.4 LTS Hardy Heron. The closest equivalent is sdparm --command=stop /dev/sdX. This will spin down but not power down the drive. But it will spin it down, and that will do for now.

One caveat for the "Safely Remove Drive" power down: this removes the device files from /dev. You have to power up the device to make them reappear.


Addendum, 2010-07-04: It appears that devkit is also not available for Ubuntu 10.4 Ludicrous Lemming, either. Use man 1 udisk instead. Great. E.g.:

udisks --detach /dev/sdb

Addendum, 2010-06-16: There is another sdparm command that is useful here, to tell the drive to flush its cache out to the platter(s). So to shut down an external drive on Hungry Hippo, use:

# flush the caches and spin down. Once DeviceKit is available, use
# "devkit-disks --detach $device"
sdparm --command=sync $device > /dev/null
sdparm --command=stop $device > /dev/null

Posted by Charles Curley | Permanent link | File under: linux

Wednesday, 2010-05-26 08:03 MDT

Ludicrous Lynx: Not Fit for Fit-PC 1

Ubuntu 10.4 "Good Buddy" has been out for a while, so I thought I'd upgrade one of my systems to give it a try. Not one of my better ideas. I backed up one of my Fit PC 1s with my bare metal recovery scripts. And a good thing, too.

I read the support information on the Fit PC support pages. While there was no driver for other models, the docs were silent on video support for the Fit-PC 1. So I decided to brave the hazards and upgrade from 9.10. The upgrade went fine until the software queried what to do about replacing a configuration file. I did what I needed to do (via ssh), and gave a keystroke to the software. No response. While the system was running and reacting to my ssh log in, the GUI had locked up.

Rebooting produced an unholy mess.

I decided to try a minimal installation. This produces a command line only installation, which bypasses the video driver issue temporarily. That worked pretty well. At one point the installer had problems pulling in some updates. When that eventually timed out, I told it to ignore the updates and proceed. It eventually finished, and I had a nice non-GUI minimal installation.

Adding GDM and X was a mistake. Ludicrous Lynx boots immediately into some graphical thing that covers over the usual boot messages. I want to see those boot messages, especially on a first boot! Anyway, on boot the video simply went away, leaving a very nice blank screen. Nice or not, that isn't what I wanted.

I am now re-installing Ubuntu 9.10, which has its own problems. But the minimal installation is definitely something to keep in mind for future efforts.

The Ubuntu folks seem bound and determined to add new features (therefor new bugs) as quickly as possible without fixing old ones. I am beginning to think I should move the Fit-PCs to Debian stable. That's a thought that bears pondering.


Posted by Charles Curley | Permanent link | File under: linux

Friday, 2010-05-14 08:33 MDT

Wi-fi owner fined for lax security in Germany

It appears that Germany fined a wi-fi owner for having lax security. Wow, what a concept, personal responsibility for the equipment you own and operate. Now, if the German courts would apply that logic to computers, they would do wonders for Linux installations.

But it will never catch on in America. Some radical nuts might apply personal responsibility to eating fattening foods, using GPS receivers, or dicey investments. Why, that would end our federal bailouts!


Posted by Charles Curley | Permanent link | File under: security, linux, law

Tuesday, 2010-05-11 12:52 MDT

New article: gnome-gps

I've added a new article, gnome-gps: a simple GTK+ GPS monitor. It's a simple (as GTK+ apps go…) program to display a minimal set of information from a GPS receiver via gpsd. Enjoy.


Posted by Charles Curley | Permanent link | File under: linux, articles

Saturday, 2010-05-08 09:53 MDT

So You Want To Phone Me, Eh?

So you want to call me on the phone, eh? That's not easy unless you meet certain criteria. Assuming I'm in (a dubious assumption these days) and I even feel like looking at the caller ID or answering the phone, I'll pick up if…

  • I recognize your phone number. That means you have your caller ID set up correctly.
  • Or you identify yourself correctly in your caller ID. I.e. the name of your company. Not the name of the holding company that owns your company; there is no reason I should know that.
  • Or your phone number is local, and, no, I'm not going to define that here.
  • And you aren't a robodialer who has given me a dead call before.

By "dead call" I mean a call where the phone rings, the recipient picks up the phone, and gets silence. There are few things a company that wants my donation can do to better ensure that I won't donate to their cause than to give me a dead call. It's an insult, pure and simple.

And, given the above, I want to talk to you. Then I might pick up.

Yes, I'm very selective about who I pick up for. Doh. With robocallers and computer generated sales pitches, pollsters, snoops and other time wasters around, consider yourself honored I even look at the caller ID display on the phone when it rings. There is simply too much telephone spam these days. And the problem will get worse as the next election approaches.

If you really want to get my attention, spend the money for some paper, some ink, and for some postage. I may still toss your missive in the round file. But it has a better chance than telephone spam.

Of course, this policy does mean I miss golden opportunities to confound telemarketers or posllsters. But it's just too easy.

Oh, and for those bottom feeders who depend on such obnoxious techniques to sell their products or otherwise acquire a living, a bit of advice: get a more honorable job, like become a congressslime or something.


Posted by Charles Curley | Permanent link | File under: miscellany

Thursday, 2010-05-06 10:18 MDT

Consumer Reports on Computer Security

I subscribe to Consumers Union's magazine Consumer Reports. The June 2010 issue has an article on computer security. (Note that the on line article is a teaser for the dead tree version, which is only available to subscribers.) Some of the statistics are interesting.

  • 24 million households "[e]xperienced heavy spam", whatever "heavy spam" means.
  • 16 million households "[h]ad serious problems in previous two years".
  • 1.8 million households "had to replace infected PCs in the past two years."
  • "Overall, we estimate that cybercrime cost American consumers $4.5 billion over the past two years. And it cause them to replace 2.1 million computers."

Much of the article goes on to discuss security on facebook. For all I know, it's good advice. I don't use farcebook, so I wouldn't know.

Associated is an article on computer security software: McAffee, Norton, etc., and rating them. The article actually mentions two free programs and gives them high ratings, the only CR Best Buy ratings in the lot: Avira Personal 9 and Microsoft Security Essentials. However, CR neglected to report that the second requires Genuine Windows, formerly Genuine Windows Advantage, definitely a strike against it.

But I wonder…. For one thing, I missed the magic word in the articles: Linux. Linux is a much more secure operating system than Windows. If you are getting ready to replace a computer, you can often extend its life by putting Linux on it: Linux is usually much less resource intensive than Windows.

For another thing, do people replace a computer solely because it is infested with malware? That doesn't sound like the best advice. Short of replacing it, you could disinfect it. If that fails, you could re-install the OS or put Linux on it. So maybe that's 2.1 million computers the owners were getting ready to replace anyway, and the malware accelerated the decision?

In my 30 years of dealing with computers, I've been hit by malware once, count it, once. It was my own dang fault: it was late and I wasn't thinking clearly, and it came in an email which claimed to be from Microsoft, and I was working for Microsoft at the time. Oops. Since I finished working there, I've switched entirely to free and open source software, and don't regret it in the least.

By neglecting to mention the magic word, CR once again flubbed its remit to help consumers protect themselves by offering all the alternatives.


Posted by Charles Curley | Permanent link | File under: consumer_reports, linux