Booting from USB drives

Gus Wirth gwirth79 at gmail.com
Mon May 13 18:17:15 PDT 2013


On 05/13/2013 11:55 AM, Franklin Johnston wrote:
> On Mon, May 13, 2013 at 11:33 AM, Wade Curry <wade-ml-kplug at syntaxman.org>wrote:
> 
>> Obvious, but easily overlooked... have you checked the BIOS
>> settings for boot device options?  Make sure the USB is bootable,
>> and make sure it is checked before your hard disk/optical disc.
>>
> 
> All of the BIOS settings appear to be correct, both in regards to POST
> settings and device priority. My proof of this is that when I boot up with
> my 32 GB Kingston drive, which is formatted with NTFS and no O/S, I get the
> message "Error loading operating system". But when I boot up with my 16 GB
> Kingston drive that has Ubuntu 13.04 on it, it's completely ignored.

The requirement for the USB stick itself to boot is that it must:

1) Have a partition. There are some USB flash drives that show up as raw
devices, for example /dev/sdc, not as /dev/sdc1 (notice the number).

2) The partition must be formatted as FAT16 or FAT32. The bootloader
used by unetbootin is Syslinux, which has a limited ability to boot a
kernel and initrd from a FAT16 or FAT32 partition. Technically, Syslinux
can also boot from FAT12 but that's usually only found on floppy disks.

3) The partition must be marked as bootable.

4) Syslinux must be installed on your system.


During the creation of the bootable USB flash drive, the drive itself
must be accessible by the user. The typical approach used by unetbootin
is to request root permission. An alternative would be to do a chmod on
the device or instead let the device mount automatically for the user,
which is the approach that I take. unetbootin can usually figure out
which device is the flash drive.

Here is an example of what is on my flash drive with a Bodhi (Ubuntu
variant) installation:

$ tree
.
├── casper
│   ├── filesystem.manifest
│   ├── filesystem.manifest-desktop
│   ├── filesystem.size
│   ├── filesystem.squashfs
│   ├── initrd.gz
│   ├── README.diskdefines
│   └── vmlinuz
├── install
│   └── memtest
├── isolinux
│   ├── boot.cat
│   ├── isolinux.bin
│   ├── isolinux.cfg
│   ├── splash.png
│   └── vesamenu.c32
├── md5sum.txt
├── menu.c32
├── preseed
│   └── custom.seed
├── README.diskdefines
├── syslinux.cfg
├── ubnfilel.txt
├── ubninit
├── ubnkern
├── ubnpathl.txt
└── ubuntu

4 directories, 23 files

Output of cfdisk (fdisk may become confused)

$ sudo cfdisk -P s /dev/sdg
Partition Table for /dev/sdg

                First       Last
  # Type       Sector      Sector   Offset    Length   Filesystem Type
(ID) Flag
 -- ------- ----------- ----------- ------ -----------
-------------------- ----
  1 Primary           0    15636095     63    15636096 W95 FAT32 (0B)
    Boot
    Pri/Log    15636096    15636303*     0         208*Free Space
    None

The single partition takes up all the space, is FAT32 and is marked
bootable.

Gus



More information about the KPLUG-List mailing list