I just assembled a new server machine, which in the end I chose to house in a shiny aluminium Thermaltake Lanbox, which is relatively compact but still roomy enough for two hard drives, a bog-standard power supply, and plenty of airflow, which is what I wanted. I also knew that the fans on this case were nice and quiet (I have a black steel version as a GPU test box, I wanted a lighter version this time!), which is important for a machine that will be on all the time.
As I said in my previous posts, I was determined not to put an optical drive in this machine. It really doesn’t need one, since all the system software will be downloaded anyway – the only possible use for an optical drive would be to boot the machine in the first instance, and that seemed a total waste. I know DVD drives are cheap, but why clutter up the box with one just for the rare occasion when I need to manually boot? The same goes for floppy drives, which are such dinosaurs I can’t believe some new machines still come with one present – the only possible use for a floppy drive these days is to provide a slot that you don’t mind a toddler feeding jam sandwiches into.
No, instead I wanted to boot from a USB flash drive. I’d never done this before, so I scouted around for the best ways to do it. Syslinux came up pretty quickly as the primary contender, but being lazy I hunted around a bit longer to see if anyone had a simpler way than configuring Syslinux manually. That’s when I came across UNetbootin.
What a fantastic little project! It took literally 5 minutes from downloading, to creating a bootable USB disk with the distribution of my choice on it (UNetbootin will download your chosen distribution automatically – or you can supply an ISO of your choice if you want), to booting up the new machine. I couldn’t believe just how simple it was! I chose to put Ubuntu 8.04 Netinstall on the disk, which clocks in at a tiny 9Mb because it’s just enough to boot up the installer to start downloading the real packages direct, but if you want, and you have a big enough USB stick, you can a complete distro on there too. But this way, I can use a crappy old USB stick I have lying around as my boot device.
A great little tool anyway. I love it when things are easier than you expect.









June 21st, 2009 at 4:33 am
“The same goes for floppy drives, which are such dinosaurs I can’t believe some new machines still come with one present”
The only real use I’ve given floppy drives in today’s computers is when I have to perform a memtest because the system is failing.
Formating a bootable USB (with memtest+) is absurdly hard (though it can be done, and this include SD cards), and it’s overkill to use a blank CD/DVD either for a couple of MBs
June 21st, 2009 at 9:45 am
For some distros, UNetbootin is simply the best choice for installing via USB(openSUSE is a good example.) In the case of Ubuntu, however, simply go to System->Administration->USB Startup Disk Creator and you can automatically create a bootable Ubuntu LiveUSB which you can then use to install on your computer. You can use the USB Startup Disk Creator directly from the LiveCD, too, so you don’t have to have an installed Ubuntu installation in the first place. I would definitely recommend this method as being the best supported and I have used it with great success for installing Ubuntu on my netbook.
Note: The USB Startup Disk Creator has only been included by default since Ubuntu Intrepid, although I believe it has been back-ported to Hardy.
June 21st, 2009 at 11:16 am
@Dark Sylinc: actually UNetbootin has built-in support for SystemRescueCD, which includes memtest+. It’s super-easy to make a bootable USB with it on!
@irrdev – that’s fine so long as you have a running version of Ubuntu already. Sure, you can create it from the LiveCD, but that assumes you have a CD drive
(I know, you could use another machine, but it’s the principle of the thing). UNetbootin is the only 1-stop way. Plus, it can create bootable installs from server ISOs rather than just the desktop version.
June 21st, 2009 at 2:38 pm
Well, turns out this wasn’t so useful after all. It’s not UNetbootin’s fault, it’s Linux and its awkward way of handling the device names for removable SCSI devices.
In order to get the USB booting, I had to set it to the top of the priority, which seems to make it get the lowest SCSI ID. That means that it always grabs /dev/sda. Because I’m using SATA disks, they get shunted to /dev/sdb onwards. This confuses the GRUB setup which then doesn’t work when you reboot without the USB stick installed. Of course, you can manually tweak the setup, but the fact that you can only do that by booting from the USB, where the devices are not correctly numbered, it makes it far more hassle than it’s worth.
Maybe there’s a way of making a bootable USB come up as the last SCSI ID instead of the first (thus not messing with the device names), but I couldn’t find it.
June 21st, 2009 at 7:14 pm
Coool about memtest! Thanks.
If I get your problem correctly, you installed from the USB, rebooted with the SATA disk, but it doesn’t boot because GRUB looks for /dev/sda and your disk is in /dev/sdb ?
If that’s the problem, rename the device from /dev/sdb to sda and you’ll be fine, udev should be saved for the next season.
Alternatively you can try “grub-install /dev/sdb” which should work (fastest solution).
Again, I’m not 100% sure what your problem is. Could you add some more details? Thanks
June 22nd, 2009 at 1:03 pm
The other way around – during install the SATA disks were sdb/sdc, then they become sda/sdb once the USB stick is removed. Also, the installer gets confused and installs grub on the USB stick :/
Thanks for the udev tip, I didnt know about renaming devices. However that’s not the whole solution, since the problem starts before the OS is loaded – the bootloader still sees the disks as different numbers depending on whether the USB stick is plugged in or not. This is solvable once you’ve got the OS installed, but the trouble is if you use any bootable recovery tools like Super Grub Disk and such, they never do the right thing by default because the numbering is never the same when booting with/without the USB stick plugged in. I discovered this when I tried to use Super Grub Disk to fix the problem, but ended up having to do everything very manually.
Since I rarely have to touch the server once it’s installed, I like to keep things as simple as possible, and the last thing I want is complications if I have to do an emergency restore or fix. So I’ve put an old DVD drive in there and it’s made things much simpler. I also found that not all ISOs were useful through UNetbootin – the Ubuntu Server ISO for example doesn’t work because it insists on looking for a CD device, despite the fact that the same media is on the USB disk it booted the installer from.
So, it was a nice idea, but in the end too much of a pain.
June 22nd, 2009 at 2:16 pm
Yes, an awfull problem. Bootable USBs aren’t that common, thus one would expect not work correctly. **Sigh** that’s a big problem to be solved yet.
The only thing coming to my mind then is to
“grub-install /dev/sdb” (install HDD bootloader)
Then
“mount /dev/sdb1 /mnt” (mount the root partition into mnt)
And then edit /mnt/boot/grub/menu-1st by replacing all the sdb entries with sda (actually you should see “hd0″ entries IIRC).
If you’re very limited, you can also perform
“chroot /mnt” after mounting the drive.
Yup, a very “automatic” solution
July 11th, 2009 at 9:54 pm
Question: I used UNetBootin on my HP G60-230US laptop. I have a Seagate 500gB Freeagent USB disk attached. UNetBootin worked perfectly (i.e., no problems), but I cannot reboot into Linux. The laptop is Vista Home Premium SP2. I’ve gone into the BIOS but when I select the USB drive, I’m back into Vista. UNetBootin said it added the boot loader. Any ideas? Very frustrating.
RON
July 23rd, 2009 at 2:13 am
listen to @irrdev he’s right, for ubuntu usb startup creator, you choose the iso it makes it bootable on your usb.