Perley's Pontificating Place

pageicon Monday Jun 16, 2008

DOS Bootable USB flash drive - how I did it

    There are 2 things you need in order to make an USB flash drive boot into DOS. The first is a boot sector, and the second are the DOS boot files. Below are the steps I used to get these onto a USB flash drive, making it possible to boot into DOS from the USB flash drive.

    The following steps where all done in Microsoft Windows XP in a VMware virtual machine. They should work with most other versions of MS Windows. I successfully used these steps on an USB flash drive I got at Immersion Week 2008 for use in a ZFS demo (Identifies itself as CBM). YMMV depending on USB flash drive model and manufacturer. These steps are based off of the very useful information at BootDisk.com.

1) Getting a boot sector on the USB flash drive
    Start by gettng the mkbt DOS utility from here mkbt
    Unzip mkbt into a temporary directory
    OK, if you are like most people these days, you don't have a floppy drive in your laptop or desktop, and you may never have, although you should know what a floppy is if you have any interest in doing this. So, if you don't have a floppy drive in your machine, you can use vfd to create a virtual floppy, which is what I did. You can get vfd from here vfd, then follow the directions for creating a virtual drive in RAM, then save it as a file for future use. Use the Windows Explorer format menu item to format the virtual floppy and make sure you check off the box to make an MS-DOS start up disk.

    Once you have access to a DOS boot floppy, use the following command, from a command prompt, to save the boot sector, where a: is the drive letter of your DOS bootable floppy (virtual or physical)

mkbt -c a: bootsect.bin

    Now use the following command to write the boot sector to your USB flash drive, where n: should be replaced with the drive letter of you USB flash drive.

mkbt -x bootsect.bin n:

2) Getting the DOS boot files
    copy all the files from the boot floppy onto the USB flash drive.

    Now you should have a DOS bootable USB flash drive, for use with a system that supports booting from USB, including x64 products from Sun. Copy over whatever DOS utilities you need to use, including AFU for Adaptec RAID controller firmware updates, which is used in some of Sun's x64 products. Or use it for whatever need you may have. Even with a small USB flash drive, you will have a lot more room than a floppy ever dreamed of. Perhaps my next blog post should be on whether inanimate objects dream. :-)

Update : Per several comment poster's, I have fixed the command line for writing the boot sector onto the USB flash drive. It is now correct in the above post. Thanks to those who caught my mistake. :-)
Share on Twitter del.icio.us furl simpy slashdot technorati digg reddit Stumble It! Share on Facebook
Comments:

Hi,
i have done everything, but still when I try to boot from my flash drive (4GB Imation) it says "No bootable partition in table". Could You plese advise me what to do?

Posted by Petar Milev on July 17, 2008 at 05:22 AM EDT #

Petar,

I'll start by saying that it has been my experience that not all USB flash devices are created equal, so there are no guarantees that a particular model can be made bootable. Did you encounter any messages, error or otherwise, during the steps, particularly step 1? One of the things I did not mention is that my USB stick was formatted with a FAT file system, so if your USB device has been formatted with some other file system, that could explain your problem.

Perley

Posted by Perley Mears on July 19, 2008 at 11:42 AM EDT #

ok

Posted by tejas jani on September 11, 2008 at 08:33 AM EDT #

i tried all above given statement, on first command, it creates bootsec.bin file in the folder i created. But the second command.

mkbt -x H: bootsec.bin
it gives message like

* expert monde (-x)
* warning different filesystem Id
Size=0bytes oem="vfd2.1" vollabe-"no Name" filesys-"fat12"

ever i formated the flash drive with fat.

Thanks

M.Yasin

Posted by yasin on November 29, 2008 at 04:32 AM EST #

HERE IS A BETTER PROGRAM
QUICK AND EASY JUST THIS PROGRAM IS ALL YOU NEED

http://www.datafilehost.com/download-288440e0.html

Posted by DONNY51972 on January 11, 2009 at 10:11 AM EST #

Another method:

Download and install WinSetupFromUSB0.1.1. Run app.
Select HP Format Tool
Format Options - Create a DOS Startup Disk, using DOS system files located at:

I pointed the path to a USB FDD which had a dos 6.22 boot disk inserted. Whola!

This creates a USB Boot stick with only command.com, IO.sys and MSDOS.sys. I used this on a SUN Server so I could upgrade the Firmware on a PCIe Qlogic HBA.

Posted by Brad on January 21, 2009 at 12:36 AM EST #

No wonder it did not work for tejas jani.
This command is plain incorrect:

mkbt -x n: bootsect.bin

It has to be mkbt -x bootsect.bin n .

I myself spent a lot of time trying to figure out what's going on until I found it here:
http://www.bootdisk.com/pendrive.htm

Posted by Victor on March 07, 2009 at 09:26 PM EST #

The command is mkbt -x bootsect.bin n:

I found however that when I tried to run this command using the letter of my usb key (m:) I kept getting an Invalid Handle message.

I tried it without the usb key in again using m: and it gave me the same error.

This lead me to think that it was not recognising the drive letter for some reason.

I then copied mkbt.exe and bootsect.bin to the m: drive via windows explorer and then through a cmd prompt switched to m: and then ran the mkbt -x bootsect.bin m: command and it ran fine giving me the expected warning about different file system.

Copied my IO.SYS and other files across rebooted and it worked just fine.

Posted by Nix on April 01, 2009 at 08:09 PM EDT #

I may have a clue on what is going on: depending on the size of the flash card, a different FAT standard applies (FAT12, FAT32) and in some cases the formatting tool may be creating a partition, in which case the first sector of the volume would contain a partition table instead of the boot sector. Try using a card of less than 4GB to see if it works.

Posted by Miguel Dutra on October 23, 2009 at 04:59 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Who is this 'Perley'?

I'm a Technical Specialist in Sun's Volume Sales Organization, helping customers understand, architect and implement Sun's various technologies and innovations, with a focus on our X64 products.

My other blog


« October 2009
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today

Feeds

Search this blog

Links

Weblog menu

Today's referrers

Today's Page Hits: 364

Locations of visitors to this page


View my blog's stats

View Perley Mears's profile on LinkedIn

My other blog

Download Java

Download Netbeans

Download Solaris

JavaFILE2