Mkdosfs

From LQWiki
Jump to navigation Jump to search

mkdosfs (make MSDOS file system) is the command to create an MS-DOS FAT32 file system under Linux, and as such similar in use to mkfs.

# mkdosfs
mkdosfs 2.8 (28 Feb 2001)
Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]
       [-m boot-msg-file] [-n volume-name] [-i volume-id]
       [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]
       [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]
       /dev/name [blocks]

For example:

mkdosfs -F 32 -n "MYFAT32" /dev/hda6

This will create a FAT32 filesystem on partition /dev/hda6 with volume label "MYFAT32". To find out which partitions you can access, use

hwinfo --partition --short