It was a month or two ago when my 40 gig hard drive started clicking. There’s only one proper reaction to such a thing: Oh, fuck. So I immediately power down the box, run to the BX, and buy a new 120 GB drive. I get back home and turn the machine back on. It’s a bit slow getting to GRUB, and the drive still sounds a bit odd, but it’s not clicking anymore. After asking around a bit on IRC on how best to backup a drive*, I power down again and open up the box. In addition to the 40 GB drive, there’s a 8-gig drive from my old computer that has been long dead. I replace the 8-gig with the 120-gig and power back up. Hey presto, the 40-gig works fine now. Being the paranoid bastard that I am, I partition the new drive exactly like the 40-gig one (of course, with an 80-gig partition at the end of it) and run partimage to copy the old partitions to the new drive.
Fast forward to Thursday, June 2. I wake up and try to use the computer. Weird graphical glitches. Okay, I need to kill and restart X.org. So I switch to another terminal. After I enter my login name, the computer shits out a long paragraph of errors. I’ve seen this before. Nothing to do but reboot and pray. And the 40-gig drive is as dead as a stone. No worries, I made backups, right? Not quite. The 120-gig drive won’t boot, either. I grab my Knoppix CD and boot from that. I can see all the stuff on the right partitions on the drive. It just needs to have GRUB installed properly on it. I do that. And on the next boot, GRUB wants to know where the kernel is. Crap. Back into Knoppix, and I can’t find the kernel anywhere. Did GRUB clobber /boot on install? It appears it did. Fortunately, I’ve still got a bzImage in /usr/src/linux. I copy it over to /boot, reboot, and tell GRUB what it wants to know. Now I’m booting. Good. Now reiserfsck is running. Hmm. It exits with an error and tells me I need to “rebuild the tree”. Crap. Zigzag, the laptop, comes to the rescue. A quick Google search tells me that I just have to run reiserfsck with “–rebuild-tree”. After some breath-holding and drama while reiserfsck does its surgery, I reboot and… everything works. I didn’t lose a damned thing.
Lessons learned:
- Backups-good.
- Reiserfs-good.
- Two computers > one computer.
*Don’t do this. Unless you think there’s only one answer to your question, don’t look to IRC for your tech support needs. Especially for Linux. I spent at least two hours while the resident gurus argued whether rsync or cp or dd or cpio would work or not.