Monday, November 28, 2011

Linux bootable USB Drives

I have a problem, I am not the proper combination of crazy/sexy/cool
to get the common tools for making bootable USB drives to work. I can
get uNetBootin ( http://unetbootin.sourceforge.net ) to work from
Windows, but not from Linux. As I have ditched Windows, having to use
windows to get the latest Linux distro CD image to boot from a USB
drive is... dumb.

I tried a bunch of tools and only succeeded in pulling out my
remaining hair. Then I found this article:
https://help.ubuntu.com/community/Installation/FromUSBStick and way,
way, way at the bottom of the article it has "Create Bootable USB
Manually". The manual process looks complex with extracting files
from the ISO and other business. As soon as I was happily taking
notes on how to follow this procedure I got to the part titled
"Simpler way using the ISO file"...

OMG! You can boot right from the ISO file itself?

So here is the process to create a bootable USB drive for a Linux LiveCD:

1. Download a LiveCD iso file. I chose Mint Linux 12 (it is my
favorite distro so far).
2. Download and extract Grub4Dos (
http://download.gna.org/grub4dos/grub4dos-0.4.4-2009-06-20.zip ).
3. Grab a junky USB drive with ~1 GB capacity and format it with FAT.
Pay attention to the device node of the USB drive.
4. Drop to a terminal window and run the following from the Grub4Dos folder:
#bootlace.com /dev/sdb (if your USB drive is at /dev/sdb!)
5. Copy grldr from the Grub4Dos folder to the USB drive.
6. Copy the LiveCD iso file to the USB drive. Pay attention to the
name of the ISO file.
7. Create a "menu.lst" file on the USB drive
The menu.lst file should look like this:

title Mint12 x64
find --set-root /mint.iso
map /mint.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz file=/cdrom/preseed/mint.seed boot=casper iso-scan/filename=/mint.iso splash quiet --
initrd /casper/initrd.lz

(it is one line starting "kernel" and the new line starts with "initrd")

8. You might need to change the Title to match your distro
(optional), replace "mint.iso" with the file name of your LiveCD iso,
and open the ISO to check for the name of the /preseed/.seed file
(ubuntu was "ubuntu.seed" and mint was "mint.seed").

Your mileage may vary, but I was able to use this to install Mint 12
on my laptop. When a new version comes out and I want to have a USB
drive that can be used to install it, all I have to do is replace the
"mint.iso" file with the new iso and I am all set.

This is the easiest way to get a bootable USB drive with a ISO... even
easier than actually using uNetBootin!

No comments:

Popular Posts