FreeDOS usb boot

Jeder kennt das Problem: immer wieder mal benötigt man einen USB Stick mit einem DOS wegen BIOS Updates, muss einen zickigen RAID-Controller flashen oder sonstiges… hier eine Kurzanleitung dazu, wie man einen bootbaren USB-Stick mit FreeDOS erstellt.

Vorbereiten der Umgebung

mkdir -p /tmp/usbboot/exec/file-system
mkdir -p /tmp/usbboot/build
cd /tmp/usbboot/build

Tool zum Schreiben der Daten auf USB-Stick herunterladen, entpacken, compilieren

wget "http://prdownloads.sourceforge.net/advancemame/makebootfat-1.4.tar.gz?download" -O - | tar -xvzf -
cd makebootfat*
./configure
make
cp makebootfat ../../exec
cd ..

Nötige FreeDOS-Binaries und MBR herunterladen

wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/kernels.zip
wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/commandx.zip
wget http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/unstablx.zip
wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-4.04.tar.gz
tar -xzvf syslinux-4.04.tar.gz syslinux-4.04/mbr/mbr.bin
mv syslinux-4.04/mbr/mbr.bin ../exec

Nun extrahiert man die relevanten Dateien aus den .zips und kopiert sie an die passende Stelle:

unzip kernels.zip
unzip commandx.zip 
unzip unstablx.zip
find ./ -name command.com -exec mv '{}' ../exec/file-system ';'
find ./ -name kernel.sys -exec mv '{}' ../exec/file-system ';'
 
for file in fat12.bin fat16.bin fat32lba.bin
do
	find ./ -name $file -exec mv '{}' ../exec ';'
done
 
cd ..
rm -fr build
cd exec

An dieser Stelle kopiert man alle Dateien, die nachher auf dem Stick liegen sollen nach ./file-system. Daraufhin befüllt man den USB-Stick per makebootfat und räumt auf.

./makebootfat -o /dev/sdb -E 255 -1 fat12.bin -2 fat16.bin -3 fat32lba.bin -m mbr.bin ./file-system
cd ../../
rm -fr usbboot

Getestet zuletzt am 17.09.2017 – sofern es nicht mehr funktioniert, bitte kurz kommentiere, dann aktualisiere ich ggfs. den Blogeintrag.

This entry was posted in Info, Rechenzentrum, Uncategorized and tagged , , , , , , . Bookmark the permalink.

4 Responses to FreeDOS usb boot

  1. admin says:

    Das liegt wohl noch am Kernel.org hack von neulich. Danke für den Hinweis!

  2. Jürgen Ott says:

    Tolle Anleitung das utils sollte noch in den Pfad
    Index of /mirrors/kernel.org/utils/boot/syslinux

    Gruß

  3. Zara says:

    I had this issue, and it wasn’t a formatting pbrloem (although thank you for the tip), but rather that the amount of space I specified to Store Changes needed to be at least 2048MB (2GB). It was an 8GB flash drive, so this was no pbrloem. The reason it needs 2GB of space is that is the minimum amount of space required to house an Ubuntu system volume. If I had opted out of retaining changes, I probably wouldn’t have even encountered this trouble, but I wanted to experiment with a portable, updateable Ubuntu install.

Leave a Reply to Zara Cancel reply

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