25.11.10

Making a Multi-Distro Linux Boot Disk

While getting ready to throw the latest ArchBang iso onto a jump drive and give it a spin, I came across this article by psychoticspoon about the installing the Gujin bootloader on a jump drive. The wife and kids are still asleep, I don't have to work today, snow is falling outside, and I have the central air on - it's the perfect environment for a little geeking out! Spoon's article was a little outdated, so I'm updating it for the current version of Gujin (2.8.2), which I grabbed from SourceForge here.

First things first, grab a USB drive that you can wipe clean. I'm using a Patriot Xporter XT 8Gb stick (thanks, Dad!), which seems to boot systems a lot faster than some of the other jump drives that I've tried.

Locate your drive in /dev (mine is at /dev/sdb), make sure that you are really okay with losing all of the data currently stored on it, and proceed with fdisk. Spoon's recommendations work just fine, minus the need to format your primary partition. Create a 16 Mb bootable primary partition, and then fill the rest of the disk with an extended partition. Create a logical partition for each of the distros that you want to be able to boot, and save the partition table to disk. I just created 3 705 Mb partitions, because I'm feeling too lazy to be exact. They just need to be big enough to hold your live iso images - if you are booting small distros, you could be much more thrifty.

Download, unpack, and expand Gujin 2.8.2, and run gujin against your fresh primary partition with the '--full' flag. My command was '.install/gujin /dev/sdb1 --full'. Answer 'yes' to format the boot partition as FAT16.

All that's left is to drop your live images onto the drive with cat. I ran 'cat archbang-2010.10-i686.iso > /dev/sdb5' to fill my first logical partition. Not quite sure why, but I had to run this using 'su', as 'sudo' didn't seem to do the trick.

And that's it! You now have a bootable USB drive, and can load it up with as many live iso images as you want. If you have Qemu, you can test the drive out without a reboot by running 'qemu -usb /dev/sdb' or something of the like.

Happy Thanksgiving!

3 comments:

  1. Only `cat` is run as root. The redirect (ie. >) is done as the user executing sudo (ie. you). I'll have to check out Gujin. That looks interesting.

    Can I make a suggestion? Change you accent and hyperlink font color. It is difficult to read that light of a colored font against a white bg. :-)

    ReplyDelete
  2. Holy carp! did you already change your theme/motif? That was quick!

    ReplyDelete
  3. Yep, that's how I roll. That, and I was already editing the layout. ;)

    The context that the redirect is made under makes sense, thanks for the clarification. Looks like 'sudo bash -c "cat distrox.iso > /dev/sdbx"' does the trick.

    ReplyDelete