Experience with installing from a USB

It is close to a year since I started writing iso images to a USB flash drive and booting from there, instead of burning a CD or DVD.  This post will describe my experience, which is mostly good.

I’ll start by briefly describing the machines where I have tried this.

I have 4 machines available.  Two of them are relatively new with 64 bit processors and a BIOS that supports booting from a USB.  One is my current desktop and the other is my current laptop.  In what follows, I shall refer to those as “newer machines”.  The other two are older machines with 32 bit processors and BIOS that does not support booting from a USB.  One of those is an older laptop, which I have relegated to testing purposes.  The other is an even older desktop that I use at work (it is sufficient for my needs there).  I shall refer to these as the older machines.

Booting the newer machines

The two newer machines are both Dells.  To boot from a USB, I hit F12 during the bootup cycle, and the BIOS presents a short menu to choose how to boot.  I have found one quirk.  If I insert the USB drive after the boot cycle has started, it sometimes hangs during boot from the USB.  I have found it better, in that case, to allow the booting to go to my normal boot menu while inserting the USB, then hit CTRL-ALT-DEL to restart the boot cycle, and now hit F12.  I could insert the USB drive before rebooting, but that can actually take longer as the operating system that is running wants to examine and possibly mount that drive.

I also experimented using PLOP boot manager on the newer machines.  Selecting a USB boot in the PLOP menu does not work.  I have to treat it as booting from the second hard drive.

USB booting on older machines

With the older machines, there is no BIOS option to boot from USB.  To work around this, I am using PLOP boot manager, which I run either from the grub menu or the windows boot manager menu.  I select the PLOP entry from my normal boot manager, and then I boot the USB from the PLOP boot menu.  With both of those older machines, I have to boot in USB 1.1 compatibility mode (use SHIFT-U on the PLOP screen) to boot from a USB.

My older laptop (now a test machine) does actually have USB 2.0 devices.  But apparently they lack full BIOS support.  If I try booting the USB in normal 2.0 mode, the system hangs and if the USB has an LED indicator, that indicator goes out.  But booting in USB 1.1 mode mostly works.  If I am booting a linux distro, then the kernel loads slowly in USB 1.1 mode.  But, once the newly loaded kernel takes over, it begins to access the device using USB 2.0 mode, so then things run more quickly.

The older desktop came only with USB 1.1 devices.  It has an add-in card with USB 2.0 ports.  If I plug the USB into a 2.0 port, the boot proceeds only until the kernel is loaded.  Then it loses contact with the USB.  If I plug into a USB 1.1 port, then it completes the boot, but I am stuck with 1.1 speeds throughout.  When I first did an install this way, I plugged the flash drive into a 1.1 port, booted the install media (the opensuse 12.1 install DVD), and did a miminal install.  Then I plugged the flash drive into a 2.0 port to add other component with the higher USB 2.0 speeds.  It turns out that this was a waste of effort.  The speed of installing is mostly limited by the slow speed of the hard drive.  The packages on the install media are compressed, and even at USB 1.1 speeds, loading a compressed package is quicker than installing that package on the hard drive.

USB booting speed

I have heard others complain that booting a USB is slow.  For me, it is quite fast on the newer machines, but slow on the older machines.  On a newer machine, the kernel loads from the USB boot, in less time than it would take to insert a CD into the CD drive.  On the older machines, it can take several minutes to load the kernel.

General procedure

I first download the iso file.  Next, I try to check its validity.  If available, I check the pgp signature (or gpg signature).  Otherwise, I check the md5 or similar checksum.  If the iso is suitable for use on a USB, then the next step is to write it to the USB.  If it is not suitable, then:

isohybrid file.iso

will usually make it suitable.  The “isohybrid” command is part of the “syslinux” package on opensuse systems.  The opensuse documentation indicates that live media should be USB ready as provided, but the DVD and NET install images require the use of “isohybrid”.

To write the image to a flash drive, I use the “dd_rescue” command.  On my desktop, where I usually do this. a flash drive is normally recognized as “/dev/sdf”.  After inserting the flash drive, I run “fdisk -l”, and scan the output to be sure that I have the correct disk device.  Then, assuming that the device is “/dev/sdf”, I use:

dd_rescue file.iso  /dev/sdf

Of course, I must make sure that the flash drive is large enough to accommodate the size of the iso file.  I use either a 4G or an 8G flash drive, depending on file size.

Testing an iso file

You can use the command

fdisk -l file.iso

to test an iso file.  An ordinary (non-root) user can do this, though “fdisk” is probably not on that user’s path.  If “fdisk” complains that there is no MBR, then the iso file is not currently suitable for booting.  If “fdisk” output shows that there is an MBR, then it might be bootable already.  However, I have had mixed luck relying on this to test bootability on a flash drive.

I used this test on one of the opensuse 12.2 Beta1 DVD iso files.  It indicated that the media did have an MBR.  So I tried booting it without running “isohybrid”.  It booted just fine, but it was unable to find the repo from which to install.  I then ran “isohybrid” on the same iso file, and tried again.  That time it booted and was able to find the repos.  I’m not quite sure what went wrong.  I think, before running “isohybrid”, it was confused on whether the boot media was a DVD or a USB flash drive, and running “isohybrid” on the iso file (and reinstalling to the flash) corrected that problem.

I also had a problem with the Mint install media.  That was supposed to be ready for use on a USB.  Booting on a newer machine, it seemed fine.  Booting on my older test machine, it was a bit flaky.  The opening screen had an option to go to a menu for selecting how to boot.  I took that option.  But, thereafter, the keyboard did not work so I could not select any boot options.  It did still boot, however.  But when I tried to install on my test machine, it reported errors in reading the install media.  I ran “isohybrid” on the iso file, reinstalled to the flash drive, and tried again.  And it then worked perfectly.

Other experience

Booting the arch linux install media worked without a hitch, using a USB flash drive.  I used the dual (32 and 64 bit) install iso for that.  Booting and installing from the Fedora 17 live KDE and the Fedora 17 DVD images also went smoothly.

When I used “fdisk” to check the ultimate boot CD iso (version 5.1.1), that turned out to not be suitable for booting from a USB.  So I ran “isohybrid” on the image and gave it a try.  It booted without a problem.  I later checked parted magic iso, and that showed up as already bootable.  As a safety precaution, I ran “isohybrid” on it anyway.  It booted without difficulty.

Summary

Based on my experience, booting install media from a USB drive works quite well.  If the iso file is using syslinux for booting, then “isohybrid” will probably work to make it bootable when installed on a USB.  And most linux based bootable CD/DVD media do use syslinux.

Advertisements

Tags: ,

About Neil Rickert

Mathematician and computer scientist who dabbles in cognitive science.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: