CD-less Baby
Filed under: compact+flash rescue hostingI've always hated putting CD-ROM drives in my rackmount equipment. They waste space, have a high failure rate and require that I keep a bunch of rescue CD's around.
I decided to investigate using a compact flash (CF) card instead. My idea was to use an IDE-to-CF converter and simply leave a small (128MB) CF card permanently installed inside the server case.
Turns out that it's not only cheaper to use CF, it's also remarkably easy.
I bought the CF->IDE converters from tekgems.com. I liked these because:
- they were bootable
- they were cheap
- simple design leaves little room for mistakes
- positive user reviews from Linux users
I ordered 10 of them for a grand total of $32USD. One thing I'd recommend is either buying a very short IDE cable (i.e. one or two inches) or an IDE gender-changer. Due to the layout of these adapters they are somewhat difficult to mount inside the case (IDE connector is on one side, floppy power connector on the other).
I happened to have a couple old 128MB SD cards lying around, so I chose to use one of them, but if I were to buy one I'd probably get a 1GB since the price difference is negligible and you'd have a bit more room to customize.
I wasn't really looking to have a full Linux live environment available. Rather I wanted the equivalent of a rescue/install CD (something to let me do repairs and/or reinstall when needed).
I'm in the process of building a new server (Opteron) for running OpenVZ on, so this was a good candidate for my test. I chose Gentoo for the host OS since I wanted to minimize downtime when upgrading the host OS.
I looked at a variety of projects for small and embedded Linux distros, but none of them really met my goals. I realized I was going the wrong direction and instead investigated simply putting the Gentoo Minimal/Install CD on the CF card.
Turns out this was not only remarkably easy (far easier than dealing with some of the micro-distros) but only took around 10 minutes.
I followed these instructions (a CF card on an IDE adapter appears to be a normal disk). I would recommend changing at least one parameter: the author puts a timeout of 150 seconds. This is way too long. I'd recommend 30 seconds top. Also, if you want to get a bit fancier, you could mount the squashfs image, customize some of the parameters (IP address, add a root password, start sshd, etc).
In a perfect world, I'd like to figure out a way of having a server failure cause it to boot from the CF card with sshd started so I could remotely access it in case of disaster (versus having the server try to boot normally and fail to complete). It's occurred to me to have the server always boot from the CF, but it's not obvious how I'd have it select whether to boot normally from that point or enter rescue mode. Too bad GRUB isn't scriptable.
In conclusion, a CF solution with a 1GB card will run you well under $20. That's cheap enough to permanently install one in every server (cheaper than a no-name CD-ROM drive and much cheaper than a slimline CD-ROM as is often found in rackmount equipment). Also, it's much easier to build a customized boot disk than with a CD (think of it in terms of ease of fixing mistakes).





