Linux mkdosfs command
The Linux mkdosfs command is used to create a DOS file system.
device refers to the device for which you want to create a DOS file system, such as /dev/hda1, etc. block_count is the number of blocks you wish to configure. If block_count is not specified, the system will automatically calculate the number of blocks matching 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:
- -c Check for bad sectors before creating the file system.
- -l Read bad sector records from the specified file.
- -f Specify the number of file allocation tables (FAT). The default value is 2. Currently the Linux FAT file system does not support more than 2 FAT tables. Usually this does not need to be changed.
- -F Specify the size of the FAT table, usually 12 or 16 bits. 12 bits are usually used for floppy disks, and 16 bits for general hard disk partitions, which is the so-called FAT16 format. Usually the system selects an appropriate value automatically. Using FAT16 on a floppy disk usually has no effect, and likewise using FAT12 on a hard disk.
- -i Specify the Volume ID. Generally it is a 4-byte number, such as 2e203a47. If not given, the system will generate one automatically.
- -m When a user tries to boot from this floppy disk or partition and there is no operating system on it, the system will give the user a warning message. This parameter is used to change that message. You can first edit it in a file and then specify it with this parameter, or use
- -m -
- In this way the system will ask you to enter the text directly. Note in particular that the string length in the file must not exceed 418 characters, including expanded tab characters (TAB) and newline characters (a newline counts as two characters under DOS!)
- -n Specify the Volume Name, which is the disk label. As with the format command under DOS, it is optional. There is no default value.
- -r Specify the maximum number of files under the root directory. The file count here includes directories. The default value is 112 or 224 on a floppy disk, and 512 on a hard disk. Do not change this number without a good reason.
- -s The number of sectors per cluster. It must be a power of 2. However, unless you know what you are doing, do not set this value arbitrarily.
- -v Provide additional information
Example
Format the floppy disk in drive A to DOS format and set the label to Tester
mkdosfs -n Tester /dev/fd0
Linux Command Reference