Saturday, 2 July 2011

The day everything went right

I've got a tag on this blog called "Whine," which I use for those frequent occasions where things don't go right. I should create a new tag, "Anti-Whine," for those less frequent occasion where they go exactly right.

Replacing my failed hard drive was just such an occasion. So this is The Perpetual Newbie's first official anti-whine.

Grocery shopping

Before going to the store, I did a little online shopping to see what I could expect to pay for a new hard drive. Somewhat to my surprise, I discovered that IDE drives (which my computer supports) are now considerably more expensive than SATA drives, the current standard (which my computer does not support). But, I soon learned, buying a SATA drive is still a bargain, because the price difference is more than enough to compensate for the additional SATA controller card that I would require.

Along the same lines, I opted also to buy a new (IDE) DVD writer. I already had a CD burner. But given that CD blanks are now harder to come by in stores, and that DVD blanks are at least the same price, if not cheaper, this too will pay for itself after a couple of spindles of discs. (It does raise the question of what we're supposed to use to create our own music CDs, but that's a whine for another post.)

So my grocery list for the trip turned out to be:

  • One Vantecc PCI 6-port SATA controller
  • One Western Digital 320 GB SATA internal hard drive
  • One LG "Super-Multi" IDE DVD burner (with a black face, so it doesn't match my 8-year-old beige box, but this is not a whine post)

Paging Dr. Howard, Dr. Fine, Dr. Howard

So with groceries in hand, it was time to mix some metaphors and do some computer surgery. I dragged my case into the living room (where the light's better), and opened it up. A small family of dust bunnies fell out of the case and immediately began doing what bunnies do so well. Back downstairs for the vacuum cleaner hose to give the PC a good internal dusting.

First in was the SATA controller card. While Vantecc calls this thing a "6-port" card, in reality it's a 4-port card, with two ports selectable as either internal (SATA) or external (eSATA). No big deal - I pulled out the manual and figured out which jumpers I had to move to enable the two eSATA ports. Turns out it was all of them. All eight of them. Easy enough to do; fortunately I hadn't cut my fingernails yet.

This computer may be 8 years old, but it still has unused PCI slots, so the next step was to knock out one of the two or three remaining blanking panels on the back of the chassis, then slide the controller card home. Minor snag: these things don't come with screws to hold them to the chassis. No matter. I've got extras. One job down, two to go.

Next up was the hard drive. The Vantecc card came with two SATA cables - but not, to my momentary frustration, a power cable. Obviously the power supply in this antique predates SATA. No matter, I happened to have a Molex-to-SATA adapter in my junk pile. So I plugged it all in and slid the drive into an empty bay.

Last came the burner. This one was simple: jumper it as a slave drive, pull out the old one, and drop in the replacement.

So far, this was turning out to be one of the easiest hardware jobs I'd ever done on a computer. I couldn't help thinking back to the days of my first computer, when IDE cables weren't keyed and the only indication you would get that you'd installed them upside-down was when you booted the computer and nothing happened. But the real question was, what happens when I turn the PC back on?

Nothing happened - nothing out of the ordinary, anyway. The BIOS recognized the new hardware and then the computer booted as usual. Huzzah!

And now . . . we wait

The next step was a software one. Now that I had a shiny new hard drive, I needed to partition and format it. So I opened up Ubuntu's Disk Utility and formatted the entire drive as a single ext4 partition.

Then, I had to copy over the entire contents of /home to the new drive. For the past two years, I've been housing my home directory on a separate partition from root. But I had always planned on going farther, and storing all the /home data on a completely different physical drive. The advantage should be self-evident: if and when I finally replace this machine, I need only install the old drive in the new one to preserve all my old data and configuration. (And buying a SATA drive now also means forward compatibility, an unintended bonus.) It also means that all my eggs aren't in one basket: if my system drive fails, my data is safe; if my data drive fails - perish the thought - then the computer is still usable.

Copying 100+ GB of personal data was extremely tedious, so I left it alone and went to make dinner.

Now, finally, I was into unexplored territory: editing /etc/fstab to tell Linux where the home directories now were. Not that I didn't know how to do this. I just didn't know how it worked. But it looked like all I had to do was replace the location of the old /home partition with the location of the new, save it, and reboot.

And that's exactly what happened. Except for a single desktop file I had uselessly deleted from the old filesystem after migrating it (so it "magically" reappeared on the new desktop), you'd never know I'd made a change at all. This is the beauty of a UNIX filesystem. It doesn't care what drive or partition things are stored on, as long as you've told it where to find them. On a Windows system, the change in drive letters would have resulted in all sorts of headaches from things being broken. But even doing this particular operation for the first time, I had no problems whatsoever.

And that is why I am not whining today.

Monday, 27 June 2011

Nobody knows the troubles I've seen

Several weeks ago, my computer began experiencing some weird crashes. These were somehow related to media, as they consistently occurred within a few minutes of starting up a player: first Rhythmbox, then Banshee and Gtkpod, and finally Clementine. I tried diagnosing the problem by figuring out what processes were running, by checking the logs to see what the computer was doing last, and so forth. No luck. I'm a do-it-yourself kind of troubleshooter - I like to solve problems myself, but in this case I gave up and took the question to the Ubuntu Forums.

An almost-random question by a helpful troubleshooter was the key: "Media is on two hard drives?" My MP3 collection sits on two physical drives: the second was originally meant to be a temporary solution to a space shortage, and it is symlinked to my music library on the main drive. A quick attempt to browse it in Nautilus hung the system. There was the problem: a failing drive occasionally causing the system to hang. The problem only manifested itself when starting a media player, because no other applications would need access to that drive.

So now I need a new hard drive. This sucks. But it's better than needing a new computer, or having to reinstall the operating system, which is annoying.

The moral of the story is: Do patronize your friendly neighbourhood forums.

Now, I can finally get on with my long-overdue evaluation of the various media players - which do not crash at random - for Linux, and why I need to use multiple tools each for few jobs, rather than one bumper-to-bumper solution.