Linux mkdosfs Command
The Linux mkdosfs command is used to create a DOS file system.
device refers to the device code on which 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 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 tracks before creating the file system.
- -l Read bad track 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-bit is usually used for floppy disks, and 16-bit for general hard disk partitions, i.e., the so-called FAT16 format. The system usually selects an appropriate value by itself. Using FAT16 on a floppy disk usually has no effect, and using FAT12 on a hard disk has no effect either.
- -i Specify the Volume ID. Generally a 4-byte number, such as 2e203a47. If not given, the system will generate one itself.
- -m When the user attempts to boot from this floppy disk or partition without an operating system on it, the system will give the user a warning message. This parameter is used to change this message. You can first edit the file with the message, then specify it with this parameter, or use
- -m -
- This way the system will ask you to directly enter the text. It is particularly important to note that the string length in the file should 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. Just like the format command under DOS, it can be given or not. There is no default value.
- -r Specify the maximum number of files in the root directory. The so-called file count here includes directories. The default value is 112 or 224 on floppy disks, and 512 on hard disks. Don't change this number unless necessary.
- -s The number of sectors per cluster. It must be a power of 2. However, unless you know what you are doing, don't set this value arbitrarily.
- -v Provide additional information
Examples
Format the floppy disk in drive A as DOS format, and set the label to Tester
mkdosfs -n Tester /dev/fd0Other Extensions
Linux Command Encyclopedia