The Personal Blog of Stephen Sekula

Cold swapping

It’s been a computer-ful week! Cooleysekula.net is, as I have mentioned before, hosted from a personal server assembled from second-hand parts. Tonight, I added one of the first major *new* parts to the system in years: a new hard drive.

For a while, I’ve known the 7-year-old drives serving as the main, root filesystem storage were going to leave this world. When I made the switch to the new PC yesterday, I noticed that the SMARTD technology in the mainboard warned me of “imminent failure” of one of the drives. I had known for a long time that one of the drives occasionally made “whir-click-click” noises. I presumed it was the oldest drive, the one storing the “root” partition where all the core system files are located.

Why wasn’t I concerned sooner? Well, several reasons. I backup every partition in its entirety every night. That way I am never more than 24 hours out-of-date on a backup. I have a parallel firewire drive that holds the copies of the main system partitions. In fact, it goes deeper than that: it’s not just a “copy”, but a complete image (using “dd”) of the partitions. That way, I can always copy the partitions **intact** to a new drive. The second reason is more time-critical: I am leaving for vacation in a week, and I need this baby to be reliable while I am gone. I host several sites that will be active in the next month, and I can’t just cross my fingers and hope.

That’s what I had to do tonight. It was a bit nail-biting, but I knew the procedure. It was just a few steps. First, copy the backed up partitions from last night to the new drive. Then, copy the more volatile and mutable files (home directories, music, e-mail, webserver stuff) over the new drive. That all took about 1 hour, limited only by disk speed and IDE throughput. Then turn off the server, swap the IDE cables so the new drive is primary and the old drives are secondary. Then boot from a rescue CD, mount the new drive, and type “grub-install /dev/hda” (GRUB is the “Grand Unified Boot Loader”) to install the master boot record. Then reboot, and the new drive is now capable of self-booting, and the rescue disk is no longer needed. That’s it! Three big steps. Copy, install master boot record (GRUB), and reboot.

And it worked. Here I am, blogging from my site on the new (very large, very inexpensive) server with its shiny new drive!