blob: 5a5086efcc1ed4c95b088433c1c0fb07fe476396 [file] [log] [blame]
Matt Mower18794c82015-11-11 16:22:45 -06001.\" mkfs.fat.8 - manpage for fs.fatck
2.\"
3.\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org>
4.\"
5.\" This program is free software: you can redistribute it and/or modify
6.\" it under the terms of the GNU General Public License as published by
7.\" the Free Software Foundation, either version 3 of the License, or
8.\" (at your option) any later version.
9.\"
10.\" This program is distributed in the hope that it will be useful,
11.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
12.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13.\" GNU General Public License for more details.
14.\"
15.\" You should have received a copy of the GNU General Public License
16.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
17.\"
18.\" The complete text of the GNU General Public License
19.\" can be found in /usr/share/common-licenses/GPL-3 file.
20.\"
21.\"
22.TH MKFS.FAT 8 2015\-05\-16 3.0.28 "dosfstools"
23.SH NAME
24\fBmkfs.fat\fR \- create an MS-DOS filesystem under Linux
25.\" ----------------------------------------------------------------------------
26.SH SYNOPSIS
27\fBmkfs.fat\fR [\fIOPTIONS\fR] \fIDEVICE\fR [\fIBLOCK-COUNT\fR]
28.\" ----------------------------------------------------------------------------
29.SH DESCRIPTION
30\fBmkfs.fat\fR is used to create an MS-DOS filesystem under Linux on a device
31(usually a disk partition).
32\fIDEVICE\fR is the special file corresponding to the device (e.g. /dev/sdXX).
33\fIBLOCK-COUNT\fR is the number of blocks on the device.
34If omitted, \fBmkfs.fat\fR automatically determines the filesystem size.
35.\" ----------------------------------------------------------------------------
36.SH OPTIONS
37.IP "\fB\-a\fR" 4
38Normally, for any filesystem except very small ones, \fBmkfs.fat\fR will align
39all the data structures to cluster size, to make sure that as long as the
40partition is properly aligned, so will all the data structures in the
41filesystem.
42This option disables alignment; this may provide a handful of additional
43clusters of storage at the expense of a significant performance degradation on
44RAIDs, flash media or large-sector hard disks.
45.IP "\fB \-A\fR" 4
46Use Atari variation of the MS-DOS filesystem.
47This is default if \fBmkfs.fat\fR is run on an Atari, then this option turns off
48Atari format.
49There are some differences when using Atari format:
50If not directed otherwise by the user, \fBmkfs.fat\fR will always use 2 sectors
51per cluster, since GEMDOS doesn't like other values very much.
52It will also obey the maximum number of sectors GEMDOS can handle.
53Larger filesystems are managed by raising the logical sector size.
54Under Atari format, an Atari-compatible serial number for the filesystem is
55generated, and a 12 bit FAT is used only for filesystems that have one of the
56usual floppy sizes (720k, 1.2M, 1.44M, 2.88M), a 16 bit FAT otherwise.
57This can be overridden with the \fB\-F\fR option.
58Some PC-specific boot sector fields aren't written, and a boot message (option
59\fB\-m\fR) is ignored.
60.IP "\fB\-b\fR \fISECTOR-OF-BACKUP\fR" 4
61Selects the location of the backup boot sector for FAT32.
62Default depends on number of reserved sectors, but usually is sector 6.
63The backup must be within the range of reserved sectors.
64.IP "\fB\-c" 4
65Check the device for bad blocks before creating the filesystem.
66.IP "\fB\-C\fR" 4
67Create the file given as \fIDEVICE\fR on the command line, and write the
68to-be-created filesystem to it.
69This can be used to create the new filesystem in a file instead of on a real
70device, and to avoid using \fBdd\fR in advance to create a file of appropriate
71size.
72With this option, the \fIBLOCK-COUNT\fR must be given, because otherwise the
73intended size of the filesystem wouldn't be known.
74The file created is a sparse file, which actually only contains the meta-data
75areas (boot sector, FATs, and root directory).
76The data portions won't be stored on the disk, but the file nevertheless will
77have the correct size.
78The resulting file can be copied later to a floppy disk or other device, or
79mounted through a loop device.
80.IP "\fB\-D\fR \fIDRIVE-NUMBER\fR" 4
81Specify the BIOS drive number to be stored in the FAT boot sector.
82This value is usually 0x80 for hard disks and 0x00 for floppy devices or
83partitions to be used for floppy emulation.
84.IP "\fB\-f\fR \fINUMBER-OF-FATS\fR" 4
85Specify the number of file allocation tables in the filesystem.
86The default is 2.
87.IP "\fB\-F\fR \fIFAT-SIZE\fR" 4
88Specifies the type of file allocation tables used (12, 16 or 32 bit).
89If nothing is specified, \fBmkfs.fat\fR will automatically select between 12, 16
90and 32 bit, whatever fits better for the filesystem size.
91.IP "\fB\-h\fR \fINUMBER-OF-HIDDEN-SECTORS\fR" 4
92Select the number of hidden sectors in the volume.
93Apparently some digital cameras get indigestion if you feed them a CF card
94without such hidden sectors, this option allows you to satisfy them.
95.IP "\fB\-i\fR \fIVOLUME-ID\fR" 4
96Sets the volume ID of the newly created filesystem; \fIVOLUME-ID\fR is a 32-bit
97hexadecimal number (for example, 2e24ec82).
98The default is a number which depends on the filesystem creation time.
99.IP "\fB\-I\fR" 4
100It is typical for fixed disk devices to be partitioned so, by default, you are
101not permitted to create a filesystem across the entire device.
102\fBmkfs.fat\fR will complain and tell you that it refuses to work.
103This is different when using MO disks.
104One doesn't always need partitions on MO disks.
105The filesystem can go directly to the whole disk.
106Under other OSes this is known as the 'superfloppy' format.
107This switch will force \fBmkfs.fat\fR to work properly.
108.IP "\fB\-l\fR \fIFILENAME\fR" 4
109Read the bad blocks list from \fIFILENAME\fR.
110.IP "\fB\-m\fR \fIMESSAGE-FILE\fR" 4
111Sets the message the user receives on attempts to boot this filesystem without
112having properly installed an operating system.
113The message file must not exceed 418 bytes once line feeds have been converted
114to carriage return-line feed combinations, and tabs have been expanded.
115If the filename is a hyphen (-), the text is taken from standard input.
116.IP "\fB\-M\fR \fIFAT-MEDIA-TYPE\fR" 4
117Specify the media type to be stored in the FAT boot sector.
118This value is usually 0xF8 for hard disks and is 0xF0 or a value from 0xF9 to
1190xFF for floppies or partitions to be used for floppy emulation.
120.IP "\fB\-n\fR \fIVOLUME-NAME\fR" 4
121Sets the volume name (label) of the filesystem.
122The volume name can be up to 11 characters long.
123The default is no label.
124.IP "\fB\-r\fR \fIROOT-DIR-ENTRIES\fR" 4
125Select the number of entries available in the root directory.
126The default is 112 or 224 for floppies and 512 for hard disks.
127.IP "\fB\-R\fR \fINUMBER-OF-RESERVED-SECTORS\fR" 4
128Select the number of reserved sectors.
129With FAT32 format at least 2 reserved sectors are needed, the default is 32.
130Otherwise the default is 1 (only the boot sector).
131.IP "\fB\-s\fR \fISECTORS-PER-CLUSTER\fR" 4
132Specify the number of disk sectors per cluster.
133Must be a power of 2, i.e. 1, 2, 4, 8, ... 128.
134.IP "\fB\-S\fR \fILOGICAL-SECTOR-SIZE\fR" 4
135Specify the number of bytes per logical sector.
136Must be a power of 2 and greater than or equal to 512, i.e. 512, 1024, 2048,
1374096, 8192, 16384, or 32768.
138.IP "\fB\-v\fR" 4
139Verbose execution.
140.IP "\fB\-\-invariant\fR" 4
141Use constants for normally randomly generated or time based data such as
142volume ID and creation time.
143Multiple runs of \fBmkfs.fat\fR on the same device create identical results
144with this option.
145Its main purpose is testing \fBmkfs.fat\fR.
146.IP "\fB\-\-help\fR" 4
147Display option summary and exit.
148.\" ----------------------------------------------------------------------------
149.SH BUGS
150\fBmkfs.fat\fR can not create boot-able filesystems.
151This isn't as easy as you might think at first glance for various reasons and
152has been discussed a lot already.
153\fBmkfs.fat\fR simply will not support it ;)
154.\" ----------------------------------------------------------------------------
155.SH SEE ALSO
156\fBfatlabel\fR(8)
157.br
158\fBfsck.fat\fR(8)
159.\" ----------------------------------------------------------------------------
160.SH HOMEPAGE
161The home for the \fBdosfstools\fR project is its
162.UR https://github.com/dosfstools/dosfstools
163GitHub project page
164.UE .
165.\" ----------------------------------------------------------------------------
166.SH AUTHORS
167\fBdosfstools\fR were written by
168.MT werner.almesberger@\:lrc.di.epfl.ch
169Werner Almesberger
170.ME ,
171.MT Roman.Hodek@\:informatik.\:uni-erlangen.de
172Roman Hodek
173.ME ,
174and others.
175The current maintainer is
176.MT aeb@\:debian.org
177Andreas Bombe
178.ME .