How to install Linux against its will

For reasons that are a long, sad, story, I needed to install RHEL/Centos/Scientific Linux to an external USB hard drive. Not a LiveUSB installer, with passwordless root, writable overlays, and all that jazz, but an honest to goodness standard install to a target that just happens to be connected via USB instead of SATA. No problem, right? Just pick your disk (they’re all SCSI as far as Linux is concerned anyway) and go for it.

Alas, no. On Scientific Linux 6.2 (and therefore presumably also RHEL and CentOS) there are an array of remarkable bugs that will prevent you from doing this. In particular, formatting the target, by any of the several available routes, will always fail, usually with an error suggestive of a race condition between the formatter and the automounter. If you preformat the drive, Disk Druid will helpfully prevent you from specifying mountpoints for the pre-existing partitions.

I spent at least a full hour probing every possible path through this thicket before I discovered the ultimate solution: run the whole thing in VirtualBox! The key insight here: VirtualBox simulated internal disk targets can actually be backed by any physical block device, including external devices. Just make a pass-through image with

sudo VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/HardDisks/sdb.vmdk -rawdisk /dev/sdb

and then launch VirtualBox, with the LiveCD ISO loaded into the virtual CD drive (no USB install stick, or messing with unetbootin or liveusb-creator, required).

I am happy to report that the virtualized text-mode install actually worked, once I enabled PAE/NX, and so long as I was willing to ignore the upper ASCII garbage occasionally dribbled onto the screen. The resulting USB drive even booted correctly on real hardware, on the first try! I feel I owe a debt of gratitude to the creators of The Matrix.

Alas, it was all for naught. NI-SCOPE 3.1 failed in ugly fashion, whether combined with NI-KAL 2.2 (which installed fine) or not. As the whole point of the exercise was to get NI-SCOPE running, I threw up my hands in despair, wiped the disk, and proceeded to plan, uh, G or something.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>