Linux mkdosfs Command
The Linux mkdosfs command is used to create a DOS file system.
The device refers to the device identifier where you want to create the DOS file system, such as /dev/hda1, etc. block_count is the number of blocks you wish to allocate. If block_count is not specified, the system will automatically calculate the number of blocks suitable for the device size.
mkdosfs [ -c | -l filename ]
[ -f number_of_FATs ]
[ -F FAT_size ]
[ -i volume_id ]
[ -m message_file ]
[ -n volume_name ]
[ -r root_dir_entry ]
[ -s sector_per_cluster ]
[ -v ]
device
[ block_count ]
Parameters:
-cChecks for bad blocks before creating the file system.-lReads bad block records from the specified file.-fSpecifies the number of File Allocation Tables (FATs). The default is 2. Currently, Linux FAT file systems do not support more than 2 FAT tables. Typically, this does not need to be changed.-FSpecifies the size of the FAT table, usually 12 or 16 bytes. 12 bytes are typically used for floppy disks, and 16 bytes for general hard disk partitions, known as FAT16 format. This value is usually selected appropriately by the system. Using FAT16 on floppy disks usually does not work, and vice versa for FAT12 on hard disks.-iSpecifies the Volume ID. It is typically a 4-byte number, like2e203a47. If not provided, the system will generate one.-mChanges the warning message displayed when a user tries to boot from this disk or partition that does not contain an operating system. You can edit the message in a file and specify it with this parameter, or use-m -to input the message directly. Note that the string length in the file should not exceed 418 characters, including expanded tab symbols (TAB) and line breaks (line breaks count as two characters in DOS!).-nSpecifies the Volume Name, i.e., the disk label. As with the format command in DOS, it is optional. There is no default value.-rSpecifies the maximum number of files in the root directory. This number includes directories. The default value is 112 or 224 on floppy disks, and 512 on hard disks. Do not change this number unless necessary.-sNumber of sectors per cluster. It must be a power of 2. Do not change this value unless you know what you are doing.-vProvides additional information.
Example
Format the disk in drive A to DOS format and set the label to "Tester":
mkdosfs -n Tester /dev/fd0