Categories
linux

Creating a DOS USB bootdisk under linux

Every now and then I need a DOS bootdisk to flash a BIOS or similar, and I only have linux with which to create it. I can never remember the quickest way to do this, so I’m documenting it here:

Lifted entirely from this webpage. I’m only archiving it here because content disappears over time.

I needed to upgrade the bios of my Computer (Intel).

But how to do it without windows?

In my case, Intel has many options for bios upgrading and one is the plain old DOS method. This is the best and fastest way to upgrade your bios with linux.
Create a FreeDOS based bootable usb-stick

* Download a FreeDOS image, i’ll use Balder for now.
* Prepare the usb-stick
o check partition (e.g cfdisk /dev/sda)
o mkfs.msdos /dev/sda1

Commands

qemu -boot a -fda balder10.img -hda /dev/sda
A:\> sys c:
A:\> xcopy /E /N a: c:

Check with

qemu -hda /dev/sda

There are, of course, many ways to do this. With recent VirtualBox versions supporting USB passthrough, I could do it entirely from a windows VM. Several other websites suggest installing grub onto the USB disk and having it boot a floppy disk image directly, which also seems like it would work. Your FAT-formatted USB drive would appear as C:, and you can just copy whatever content you like straight onto that.

11 replies on “Creating a DOS USB bootdisk under linux”

Perfect!! This is the simplest way I’ve seen to create a USB Stick with full access to the Stick’s storage space instead of being limited to 1.44MB or 2.88MB within the image. Thanks!

THANKS for your hints above.

It didn’t work like you described but gave enough to get me there. I kept having problems with MBR data either being wrong or missing and just went in circles between your creative solution of using QEMU and others who tried to use all linux tools.

I finally resorted to a QEMU only solution.

nuking anything on the drive with something like:
dd if=/dev/zero of=/dev/sdd bs=512 count=1000
this gets the MBR as well.

then going straight into qemu like you suggest

qemu -boot a -fda balder10.img -hda /dev/sdd

fdisk (create primary drive)
exiting from qemu

starting qemu again
qemu -boot a -fda balder10.img -hda /dev/sdd
format c:
sys c:
xcopy /E /N a: c

Thanks for your instructions and especially for comments from Mike (Sep 7 2010). Only worked when I followed Mike’s routine (because I think the partition needed to be made active/bootable, and I forgot this in GParted).

Now I have my Dell Q15R N5110 with the latest BIOS (A10), by running the utility within a Freedos USB key and without installing Windows 7, Yay!

It looks like, that over the intervening years the qemu command has been changed to:

qemu-system-i386

at least on my fedora disto!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.