Hi,
I had to spend quite a while reading through multiple documents to figure out how to get a working bootable USB boot disk for DOS using Fedora 12. I needed the dos boot disk to flash my motherboard BIOS as it did not support linux for updating the bios. Thought I'd put the steps involved to help other people who wanted to do something similar. The steps outlined here are for a Fedora 12 system. You should be able to extrapolate the minor changes that may be required for other linux distributions. All commands listed below to be typed in on a command prompt, logged in as root. Here goes...
1. Prerequisites:
syslinux
testdisk
freedos base cd (
http://www.freedos.org/)
If you don't have syslinux and testdisk, you can install them with the following command from a command prompt:
yum install syslinux testdisk
If you haven't already downloaded the FreeDOS Base CD ISO, you can do it from the following URL:
http://www.ibiblio.org/pub/micro/pc-...0/fdbasecd.iso (About 8MB in size).
2. Prepare the USB flash drive:
Warning - this will erase all existing data on your flash disk. Please make a backup of your USB flash disk data, if you need to.
Plug in your USB flash disk, find out which /dev/xxx entry it uses by looking at /var/log/messages, and using "fdisk"
- create a single primary partition on your USB flash disk
- change the partition type to FAT16 (type 06)
- mark the single primary partition as bootable
- write changes and exit fdisk.
3. Create a formatted dos filesystem on the USB disk with the following command:
mkdosfs /dev/xxxA
at a command prompt, where xxx corresponds to the device name (eg: sdc) that your plugged in USB disk, and A is the partition that you'd like the filesystem to be created in (usually "1" in this case).
4. Install a master boot record (MBR) on the USB disk using testdisk by typing the following command:
testdisk
at a command prompt and using the following options from the program
- select [No Log]
- From the menu, select the disk that corresponds to your USB disk.
- select [Intel ]
- select [MBR Code]
- type "Y" when it prompts you to 'Write a new copy of MBR code to first sector? (Y/N)"
- type "Y" when it prompts you to "Write a new copy of MBR code, confirm ? (Y/N)"
- select [Ok]
- select [Quit]
- select [Quit]
5. Install a bootloader on the USB disk using syslinux, by typing the following command:
syslinux -s /dev/xxxA
at a command prompt where xxx corresponds to the device that corresponds to the device name (eg: sdc) of your USB disk and A is the partition that you want the bootloader to be installed in (usually "1" in this context).
6. Mount the partition on the USB disk using the following command:
mount /dev/xxxA /mnt
at a command prompt where xxx corresponds to the device that corresponds to the device name (eg: sdc) of your USB disk and A is the partition that you want the bootloader to be installed in (usually "1" in this context).
7. Mount your FreeDOS base CD ISO image that you downloaded earlier, with the following command:
mkdir /tmp/freedos
mount -o loop <path-to-fdbasecd.iso> /tmp/freedos
8. Copy all files from the FreeDOS ISO image that you mounted on /tmp to the partition in the USB disk with the following command:
cp -a /tmp/freedos/* /mnt/
9. Create the appropriate configuration files on the USB disk by typing the following from a command prompt:
cp /mnt/isolinux/isolinux.cfg / mnt/syslinux.cfg
cp /mnt/isolinux/* /mnt
10. Unmount mounted partitions with the following commands from a command prompt:
umount /mnt
umount /tmp/freedos
Reboot your PC with your USB disk plugged in, select the relevant BIOS options from the BIOS setup menu to boot from this USB disk, and it should work.
Would love to hear your feedback if this mini howto was helpful / unhelpful to you.
Acknowledgements:
1. Leigh123linux @
http://forums.fedoraforum.org/showpo...55&postcount=2 for enlightening me on the fact that testdisk could be used instead of install-mbr
2.
https://www.ilikelinux.com/tips-and-...stick-in-linux upon which this howto is broadly based.
--Vinu.