Rest In Peace Linux

Or was that Recovery Is Possible? For a bit more on using a live CD to rescue a machine, see my notes from January.

I had this fantasy (oh, what a fantasy) that puzzles like this were behind me, but I found myself, once again, staring at a wackadoo screen that was decidedly not Windows launching. Something about a boot disk and not being able to find one.

For what it is worth, I’d seen this screen on this machine (we’ll call ‘im Dusty; up until now he’d been named for his last owner, a woman who has nothing to do with the demise of Dusty) before and the last time I saw this screen, I took Dusty apart, plugged everything in tight and tried again. When he launched I said something vague and non-commital like “got it running, but I can’t promise I’ll ever be able to do that again. You should make sure you have whatever backups you need and we should replace this computer.” My esteemed colleague apparently heard “don’t turn it off and you’ll be fine.”

Lesson 1: Clarity is not as easy as you think it is.

I’ve been through the computer-wants-to-die before, so I turned it off, requisitioned a new machine, and went home to ask my friends what the hell I was supposed to do.

You don’t really want the narrative (I hope, cuz I don’t want to write it) but here is what i did, on DKG’s advice. The short version is “RIP Linux, sshfs, ddrescue” — those were the notes I had from DKG. Here is what I did with those notes:

  • Burn an RIP Linux CD. For all I know knoppix would also have worked, but I went with RIP because DKG usually knows of what he speaks.
  • Fiddle with the bios (F2) to convince Dusty to boot from CD
  • Boot Dusty from CD (secretly, I already had a Linux box–Beastie–on the network with a spare drive that had plenty of room for Dusty’s remains.) and run, per the boot screen, dhcpd to get onto the network. RIP Linux runs as root, so if you are trying to interpret this for your own use in some other context, you may need to insert a sudo or two.
  • Install sshd on Beastie with sudo apt-get install ssh (it took me longer than it should have to figure out what the package was called. I was looking for a package called sshd not ssh.
  • Create a mount point on Dusty, mkdir /mnt/beastie (I know that makes things confusing, but it made perfect sense to me)
  • Mount Beastie’s spare HD (/mnt/backupdr on Beastie) on Dusty with (sshfs is part of RIP Linux, with good reason) with a little sshfs amanda@192.168.1.102:/mnt/backupdir /mnt/beastie. If you need that decoded:
    • 192.168.1.102 is the IP address of Beastie on the network (try ifconfig if you need that info and you are too tired to remember how to find it)
    • amanda is my username on Beastie (go figure …)
    • /mnt/backupdir is the mountpoint on Beastie of the spare drive that is going to bail me out
    • /mnt/beastie is the mountpoint on Dusty of Beastie
  • ddrescue /dev/sda1 /mnt/beastie/dusty_hd — that took the whole partition (/dev/sda1 — try fdisk -l if you want to find available drives) and copied it to a file named “dusty_hd” on Beastie. From Beastie I could access the same file at /mnt/backupdr/dusty_hd. That didn’t take nearly as long as I thought it would and I didn’t get any errors. Whew.

Here is where it all started to get sticky and I stopped being able to just read man pages and plug on. What the heck can I do with this thing, this “dusty_hd” file? Because I’m smart like that, I tried …

sudo mount -v -o loop,ro /mnt/backupdr/dusty_hd /mnt/dusty_hd -t vfat (first I created the mountpoint …) which didn’t work. Something about a bad superblock. I tried a bunch of other things, including a lot of google searching and then another friend (who’d done a fair bit of handholding already. Thanks!) suggested fsck:

fsck.vfat -a /mnt/backupdr/dusty_hd

That made some noise, logged some errors (that I didn’t write down …) and ultimately worked. After fsck I was able to mount “dusty_hd” and do whatever with its contents.

I could ramble about what I learned in all of this, but I don’t really remember learning much besides “riplinux, sshfs, ddrescue”. By the I’d restored our accounting files, I couldn’t begin to remember how to run the smartmon tools to satisfy my curiosity about the demise of Dusty. He’s been sent to his final resting place now, so there is no turning back. We may never know.

Comments

on modern debian-based linux distributions (post sarge, anyway), the canonical ssh server is broken out into a separate package called openssh-server.

there are other ssh daemons available too (e.g. lsh-server, dropbear) but openssh is the most commonly-used one.

posted by dkg on 01.08.07 at 6:31 pm

[...] ISO depends a lot on what you’re trying to do, but RIP Linux (which I’ve written about before) is one good option for recovery operations. Maybe you want an Ubuntu Live CD or a Debian Live [...]

posted by » Bootable Velo, Rapido on 05.26.10 at 3:28 pm

Leave a comment