MAKEBOOTFAT(1)

πŸ“¦
version 1.4 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’Ύ makebootfat β€” the bootable FAT disk maker, bestie edition

okay so real quick, the manual name is makebootfat and it lives in the General Commands Manual, section 1. And it's literally the tool that "Makebootfat Bootable FAT Disk Creation" β€” that's the whole job description, periodt.


✨ NAME ✨

makebootfat β€” Makebootfat Bootable FAT Disk Creation πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

makebootfat [options] IMAGE

🌸 DESCRIPTION 🌸

This utility creates a bootable FAT filesystem and populates it with files and boot tools. Like, it doesn't just make a filesystem, it fills it β€” files, boot tools, the whole vibe. πŸ‘‘

It's mainly designed to create bootable USB and Fixed disk for the AdvanceCD project. iykyk.

The official site of AdvanceCD and makebootfat is:

http://advancemame.sourceforge.net/

πŸ’– OPTIONS πŸ’–

  • -o, --output DEVICE β€” tell it where to write, bestie. This has to be the device where you want to set up the filesystem. There's a lil magic value, usb, and if you use it, it automatically picks the USB Mass Storage device connected at the system. This option is always required. no skips, no shortcuts.
  • -b, --boot FILE
  • -1, --boot-fat12 FILE
  • -2, --boot-fat16 FILE
  • -3, --boot-fat32 FILE

These specify the FAT boot sector images to use. The -b option uses the same sector for all the FAT types. The other options can be used to specify a different sector for different FAT types. The FAT types for which a boot sector is not specified are not used. This option is always required. (yes, one of these. you gotta feed it a boot sector fr fr.)

  • -m, --mbr FILE β€” specifies the MBR sector image to use. If you specify this, a partition table gets created on the disk. If you don't, the disk is filled without a partition table, like a floppy disk. your choice, bestie πŸ’…
  • -F, --mbrfat β€” changes the MBR image you gave with -m so it pretends to be a FAT filesystem starting from the first sector of the disk. This lets you boot from USB-FDD (Floppy Disk Drive) while also using a partition table, which is generally required by USB-HDD (Hard Disk Drive). The MBR image specified with -m must have executable code positioned like a FAT boot sector. You can use the included mbrfat.bin file. ✨
  • -c, --copy FILE β€” copies the specified file into the root directory of the disk. It's copied using the readonly attribute. πŸŽ€
  • -x, --exclude FILE β€” excludes the specified files and subdirectories in the IMAGE directory from being copied. The path must be specified using the same format used in the IMAGE directory specification. (keep that consistent, queen.)
  • -X, --syslinux2 β€” enforces the syslinux 2.xx FAT limitations. Syslinux 2.xx doesn't support FAT32 at all, and it doesn't support FAT16 with 64 and 128 sectors per cluster formats. This option excludes all the FAT formats not supported by syslinux. Heads up though: it limits the maximum size of filesystem to 1 GB. 😭
  • -Y, --syslinux3 β€” enforces the syslinux 3.xx FAT support. Syslinux 3.00 supports all the FAT types and sizes, but it requires a special customisation of the boot sector and of the file ldlinux.sys. This option does that customisation for you, without needing the syslinux installer β€” as long as the ldlinux.sys file is copied on disk with the -c option. slay. πŸ’…
  • -Z, --zip β€” if possible, forces ZIP-Disk compatibility. It sets a geometry of 32 sectors and 64 heads. It also uses the 4'th partition entry in the partition table. It's required to boot also in USB-ZIP mode.
  • -P, --partition β€” ensures it operates on a partition and not on a disk.
  • -D, --disk β€” ensures it operates on a disk and not on a partition.
  • -L, --label LABEL β€” sets the FAT label. The label is a string of 11 chars.
  • -O, --oem OEM β€” sets the FAT OEM name. The OEM name is a string of 11 chars.
  • -S, --serial SERIAL β€” sets the FAT serial number. The serial number is a 32 bit unsigned integer.
  • -E, --drive DRIVE β€” sets the BIOS drive to set up in the FAT boot sector. Generally this value is ignored by boot sectors β€” with the exception of the FAT12 and FAT16 FreeDOS boot sectors, which require the correct value, or the value 255 to force auto detection. don't skip this one for FreeDOS, fr fr. 🫢
  • -v, --verbose β€” prints some information on the device and on the filesystem created. gossip but for disks. πŸ’–
  • -i, --interactive β€” shows the errors in a message box. Only for Windows.
  • -h, --help β€” prints a short help.
  • -V, --version β€” prints the version number.
  • IMAGE β€” directory image to copy on the disk. All the files and subdirectories present in this directory are copied on the disk. the main character tbh πŸ‘‘

🧚 DISKS AND PARTITIONS NAMES 🧚

In Linux, disk devices are named /dev/hdX or /dev/sdX where X is a letter. Partition devices are named /dev/hdXN or /dev/sdXN where X is a letter and N a digit.

In Windows, disk devices are named \\.\PhysicalDriveN where N is a digit. Partition devices are named \\.\X: where X is a letter β€” but sometimes \\.\X: is a disk and not a partition, for example on floppies and on all the USB Mass Storage devices without a partition table. sneaky lil detail, ik. πŸ‘€


🌈 SYSLINUX 🌈

To make a bootable FAT using syslinux you must use the -X option for syslinux version 2.xx, or the -Y option for syslinux version 3.xx. You must also copy into the root directory of the disk these files:

  • ldlinux.sys β€” the syslinux loader.
  • syslinux.cfg β€” the syslinux configuration file.
  • linux β€” the Linux kernel image (the file name may be different).
  • initrd.img β€” the initrd filesystem (the file name may be different or missing).

You must also specify the ldlinux.bss boot sector with the -b option, and possibly the mbr.bin MBR sector with the -m option. Both of those sector images are present in the syslinux package. πŸ’Ύ

For example:

makebootfat -o usb \
     -Y \
     -b ldlinux.bss -m mbr.bin \
     -c ldlinux.sys -c syslinux.cfg \
     -c linux -c initrd.img \
     image

πŸ“ LOADLIN AND FREEDOS πŸ“

To make a bootable FAT using loadlin and FreeDOS you must copy into the root directory of the disk these files:

  • kernel.sys β€” the FreeDOS kernel. Remember to use the 32 kernel version to support FAT32. (do NOT forget this one bestie 😭)
  • command.com β€” the FreeDOS shell.
  • autoexec.bat β€” used to start loadlin.
  • loadlin.exe β€” the loadlin executable.
  • linux β€” the Linux kernel image (the file name may be different).
  • initrd.img β€” the initrd filesystem (the file name may be different or missing).

You must also specify the FreeDOS boot sectors available on the FreeDOS sys source package with the -1, -2, -3 options. For the MBR you can use the sector image available on the FreeDOS fdisk source package.

For example:

makebootfat -o /dev/hda1 \
     -E 255 \
     -1 fat12com.bin -2 fat16com.bin -3 fat32lba.bin \
     -c kernel.sys -c command.com \
     -c autoexec.bat -c loadlin.exe \
     -c linux -c initrd.img \
     image

πŸ‘‘ MULTI STANDARD USB BOOTING πŸ‘‘

The BIOS USB boot support is generally differentiated into three categories: USB-HDD, USB-FDD and USB-ZIP. three flavors, one disk, we love a multitasker.

The USB-HDD (Hard Disk Drive) standard is the preferred choice, and it requires the presence of a partition table in the first sector of the disk. You can create this type of disk using the -m option.

The USB-FDD (Floppy Disk Drive) standard requires the presence of a filesystem starting from the first sector of the disk, without a partition table. You can create this type of disk without using the -m option.

The USB-ZIP (ZIP Drive) standard requires the presence of a device with a very specific geometry. Specifically, it requires a geometry with 32 sectors and 64 heads. It also requires the presence of a partition table with only a bootable partition in the fourth entry. You can create this type of disk using the -m and -Z option.

Generally these standards are incompatible β€” but using the -m, -F and -Z options you can create a disk compatible with all of them. iconic behaviour, honestly.

To use the -F option, the MBR image specified must follow these constrains:

  • It must start with a standard FAT 3 bytes jump instruction.
  • It must have the bytes from address 3 to 89 (included) unused.

An example of such an image is in the mbrfat.bin file.

For example, to create a syslinux image:

makebootfat -o usb \
     -Y \
     -Z \
     -b ldlinux.bss -m mbrfat.bin -F \
     -c ldlinux.sys -c syslinux.cfg \
     -c linux -c initrd.img \
     image

and for a FreeDOS and loadlin image:

makebootfat -o usb \
     -E 255 \
     -Z \
     -1 fat12com.bin -2 fat16com.bin -3 fat32chs.bin \
     -m mbrfat.bin -F \
     -c kernel.sys -c command.com \
     -c autoexec.bat -c loadlin.exe \
     -c linux -c initrd.img \
     image
Please note that FreeDos has some problems booting from USB. It works only on very few conditions. 😭 not me warning you twice.

πŸŽ€ EXCLUSION πŸŽ€

To exclude some files or directories in the image copy, you can use the -x option using the same path specification which you are using for the image directory.

For example, if you need to exclude the isolinux and syslinux subdirectories from the image directory, you can use the command:

makebootfat ... \
     -x image/isolinux \
     -x image/syslinux \
     image

This file is Copyright (C) 2004, 2005 Andrea Mazzoleni


πŸ”₯ SEE ALSO πŸ”₯

syslinux(1), mkdosfs(1), dosfsck(1)


okay that's the whole page bestie, no cap πŸ’… and just so you know, the footer of this thing is literally just the same title again β€” Makebootfat Bootable FAT Disk Creation (1) β€” so go forth and make bootable disks, you absolute icon. πŸ«Άβœ¨πŸ’–