Programmer’s Log Programmers Writing Stuff – Garry Bodsworth

23Jun/092

“Boot Error” when booting from USB

Some BIOS have problems booting from USB pen drives. This lead to to what I consider an insane discovery, USB flash drives have heads, cylinders, and sectors/tracks, but they are entirely virtual.

What your normally end up with is a prompt saying "Boot Error" and nothing else of use. This is because some BIOS are limited to 1024 cylinders so you need to change the geometry of the flash drive.

You can do this in Linux with the following commandline (where sdX is the device which is the usb flash storage):

mkdiskimage -4 /dev/sdX 0 63 62

The numbers depend on the size of the USB key as they need to be chosen to get a total number of cylinders less than 1024.

A 1GB stick would be:

mkdiskimage -4 /dev/sdX 0 64 32

A 1GB-2GB stick would be:

mkdiskimage -4 /dev/sdX 0 128 32

A 2GB-8GB stick would be:

mkdiskimage -4 /dev/sdX 0 255 63

Once your geometry is set up you can go ahead and partition your device and use it.

Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • LinkedIn
  • Tumblr
  • Twitter
Comments (2) Trackbacks (0)
  1. please let me know how to achieve the same from windows XP

  2. Wow, thank you so much for this post. I’ve spent over 100 hours in the last couple of weeks trying to figure out why my USB sticks were no longer being recognized as boot devices on my PC. After reformatting, one at a time, they were all failing. Knew it had to be something very basic, like a bios problem, but was getting no errors. The USB sticks were simply ignored.

    Finally I dd’d a kilobyte from /dev/zero to one stick and started getting the “Boot error” message. Which, in turn, let me here.
    Saludos!


Leave a comment


No trackbacks yet.