← 返回命令列表

Linux command

mkdosfs 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create FAT filesystem

mkdosfs [/dev/sdb1]

Create FAT32

mkdosfs -F [32] [/dev/sdb1]

Create FAT16

mkdosfs -F [16] [/dev/sdb1]

Set volume label

mkdosfs -n "[LABEL]" [/dev/sdb1]

Verbose output

mkdosfs -v [/dev/sdb1]

Create a FAT filesystem in an image file

mkdosfs -C [disk.img] [size_in_blocks]

Check for bad blocks

mkdosfs -c [/dev/sdb1]

说明

mkdosfs creates MS-DOS FAT filesystems. It formats devices with FAT12, FAT16, or FAT32. The tool is also known as mkfs.fat. Used for USB drives and compatibility.

参数

-F _SIZE_
FAT size (12, 16, or 32).
-n _LABEL_
Volume label.
-c
Check for bad blocks before creating filesystem.
-C
Create the file given as DEVICE and write the filesystem to it (for image files).
-I
Allow formatting the entire disk device without a partition table (superfloppy format).
-s _SECTORS_
Number of disk sectors per cluster (must be a power of 2).
-S _SIZE_
Number of bytes per logical sector (512, 1024, 2048, etc.).
-v
Verbose output.
--help
Display help information.

FAQ

What is the mkdosfs command used for?

mkdosfs creates MS-DOS FAT filesystems. It formats devices with FAT12, FAT16, or FAT32. The tool is also known as mkfs.fat. Used for USB drives and compatibility.

How do I run a basic mkdosfs example?

Run `mkdosfs [/dev/sdb1]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -F _SIZE_ do in mkdosfs?

FAT size (12, 16, or 32).