Today, I spent a lot of time fussing with bootable USB thumbsticks, trying to set one up that would boot the new backup server I just built at work. The machine has no optical drive, so I just wanted to boot a simple netinstall and have the system pull everything it needs from remote mirrors.
The supposed easy method was to use Unetbootin. Everything about it was easy, except for the part where the bootable USB sticks it created didn’t work. Every boot attempt was met with “Boot error” or “Missing operating system”.
Since I am on Ubuntu, I tried to use Ubuntu’s usb-creator. Also a nice app, except for the fact that it too failed to work. In usb-creator’s case, the failure was to even get started. I would browse to the ISO that I wanted to use as the image for my boot stick, and the app refused to load it, or any ISO. No error, the app simply didn’t respond to the input.
So, two piece-a-junk GUI apps down. After a little digging, I found the methods that created working USB sticks on the first try.
For CentOS:
- Download diskboot.img from a CentOS mirror’s centos/(version)/os/(arch)/images folder. (I used the kernel.org mirror and i386 arch, so my diskboot.img was located at: http://mirrors.kernel.org/centos/5.5/os/i386/images/)
- Insert USB stick (I’ll assume it’s /dev/sdb, adjust instructions to fit your system), format to FAT32 (I used Gparted for this)
- Run:
dd if=diskboot.img of=/dev/sdb
- Remove USB drive, stick into machine that’s getting the CentOS install, and boot
When asked for installation media, select HTTP. Use the website and folder path of the mirror you’re using.
So, from my example:
Website name: mirrors.kernel.org
CentOS directory: centos/5.5/os/i386
Proceed through installer as normal.
For Debian:
- Download boot.img.gz from /debian/dists/(version)/main/(installer-arch)/current/images/hd-media folder
(I did i386 stable from Debian’s US mirror, so boot.img.gz was located at:
http://ftp.us.debian.org/debian/dists/stable/main/installer-i386/current/images/hd-media/) - Download Debian netinstall ISO (I used: http://cdimage.debian.org/debian-cd/5.0.5/i386/iso-cd/debian-505-i386-netinst.iso)
- Insert USB drive (again I’ll assume /dev/sdb) and format to FAT32
- Run:
zcat boot.img.gz > /dev/sdb
- Remove and re-insert USB drive. Copy the netinstall ISO to the USB drive.
- Stick USB into machine getting the Debian install, boot, and run through installer.
I imagine these instructions will probably stay good for a long time. You’ll just need to adjust for mirror location, arch and release numbers, but the URLs I’ve provided here should give you a good clue as to where to find the necessary files on the mirror you’re using.