blob: 9100c39b4a63ec2738f150af90b4e41f5e95449e [file] [log] [blame]
bigbiff bigbiff9c754052013-01-09 09:09:08 -05001.\" -*- nroff -*-
2.TH MKDOSFS 8 "5 May 1995" "Version 2.x"
3.SH NAME
4.B mkdosfs
5\- create an MS-DOS file system under Linux
6.SH SYNOPSIS
7.B mkdosfs|mkfs.msdos|mkfs.vfat
8[
9.B \-a
10]
11[
12.B \-A
13]
14[
15.B \-b
16.I sector-of-backup
17]
18[
19.B \-c
20]
21[
22.B \-l
23.I filename
24]
25[
26.B \-C
27]
28[
29.B \-f
30.I number-of-FATs
31]
32[
33.B \-F
34.I FAT-size
35]
36[
37.B \-h
38.I number-of-hidden-sectors
39]
40[
41.B \-i
42.I volume-id
43]
44.RB [ " \-I " ]
45[
46.B \-m
47.I message-file
48]
49[
50.B \-n
51.I volume-name
52]
53[
54.B \-r
55.I root-dir-entries
56]
57[
58.B \-R
59.I number-of-reserved-sectors
60]
61[
62.B \-s
63.I sectors-per-cluster
64]
65[
66.B \-S
67.I logical-sector-size
68]
69[
70.B \-v
71]
72.I device
73[
74.I block-count
75]
76.SH DESCRIPTION
77.B mkdosfs
78is used to create an MS-DOS file system under Linux on a device (usually
79a disk partition).
80.I device
81is the special file corresponding to the device (e.g /dev/hdXX).
82.I block-count
83is the number of blocks on the device. If omitted,
84.B mkdosfs
85automatically determines the file system size.
86.SH OPTIONS
87.TP
88.B \-a
89Normally, for any filesystem except very small ones, \fBmkdosfs\fP
90will align all the data structures to cluster size, to make sure that
91as long as the partition is properly aligned, so will all the data
92structures in the filesystem. This option disables alignment; this
93may provide a handful of additional clusters of storage at the expense
94of a significant performance degradation on RAIDs, flash media or
95large-sector hard disks.
96.TP
97.B \-A
98Use Atari variation of the MS-DOS file system. This is default if
99\fBmkdosfs\fP is run on an Atari, then this option turns off Atari
100format. There are some differences when using Atari format: If not
101directed otherwise by the user, \fBmkdosfs\fP will always use 2
102sectors per cluster, since GEMDOS doesn't like other values very much.
103It will also obey the maximum number of sectors GEMDOS can handle.
104Larger file systems are managed by raising the logical sector size.
105Under Atari format, an Atari-compatible serial number for the
106file system is generated, and a 12 bit FAT is used only for file systems
107that have one of the usual floppy sizes (720k, 1.2M, 1.44M, 2.88M), a
10816 bit FAT otherwise. This can be overridden with the \fB\-F\fP
109option. Some PC-specific boot sector fields aren't written, and a boot
110message (option \fB\-m\fP) is ignored.
111.TP
112.BI \-b " sector-of-backup "
113Selects the location of the backup boot sector for FAT32. Default
114depends on number of reserved sectors, but usually is sector 6. The
115backup must be within the range of reserved sectors.
116.TP
117.B \-c
118Check the device for bad blocks before creating the file system.
119.TP
120.B \-C
121Create the file given as \fIdevice\fP on the command line, and write
122the to-be-created file system to it. This can be used to create the
123new file system in a file instead of on a real device, and to avoid
124using \fBdd\fP in advance to create a file of appropriate size. With
125this option, the \fIblock-count\fP must be given, because otherwise
126the intended size of the file system wouldn't be known. The file
127created is a sparse file, which actually only contains the meta-data
128areas (boot sector, FATs, and root directory). The data portions won't
129be stored on the disk, but the file nevertheless will have the
130correct size. The resulting file can be copied later to a floppy disk
131or other device, or mounted through a loop device.
132.TP
133.BI \-f " number-of-FATs"
134Specify the number of file allocation tables in the file system. The
135default is 2. Currently the Linux MS-DOS file system does not support
136more than 2 FATs.
137.TP
138.BI \-F " FAT-size"
139Specifies the type of file allocation tables used (12, 16 or 32 bit).
140If nothing is specified, \fBmkdosfs\fR will automatically select
141between 12, 16 and 32 bit, whatever fits better for the file system size.
142.TP
143.BI \-h " number-of-hidden-sectors "
144Select the number of hidden sectors in the volume. Apparently some
145digital cameras get indigestion if you feed them a CF card without
146such hidden sectors, this option allows you to satisfy them. Assumes
147\'0\' if no value is given on the command line.
148.TP
149.I \-i " volume-id"
150Sets the volume ID of the newly created file system;
151.I volume-id
152is a 32-bit hexadecimal number (for example, 2e24ec82). The default
153is a number which depends on the file system creation time.
154.TP
155.B \-I
156It is typical for fixed disk devices to be partitioned so, by default, you are
157not permitted to create a filesystem across the entire device.
158.B mkdosfs
159will complain and tell you that it refuses to work. This is different
160when using MO disks. One doesn't always need partitions on MO disks.
161The file system can go directly to the whole disk. Under other OSes
162this is known as the 'superfloppy' format.
163
164This switch will force
165.B mkdosfs
166to work properly.
167.TP
168.BI \-l " filename"
169Read the bad blocks list from
170.IR filename .
171.TP
172.BI \-m " message-file"
173Sets the message the user receives on attempts to boot this file system
174without having properly installed an operating system. The message
175file must not exceed 418 bytes once line feeds have been converted to
176carriage return-line feed combinations, and tabs have been expanded.
177If the filename is a hyphen (-), the text is taken from standard input.
178.TP
179.BI \-n " volume-name"
180Sets the volume name (label) of the file system. The volume name can
181be up to 11 characters long. The default is no label.
182.TP
183.BI \-r " root-dir-entries"
184Select the number of entries available in the root directory. The
185default is 112 or 224 for floppies and 512 for hard disks.
186.TP
187.BI \-R " number-of-reserved-sectors "
188Select the number of reserved sectors. With FAT32 format at least 2
189reserved sectors are needed, the default is 32. Otherwise the default
190is 1 (only the boot sector).
191.TP
192.BI \-s " sectors-per-cluster"
193Specify the number of disk sectors per cluster. Must be a power of 2,
194i.e. 1, 2, 4, 8, ... 128.
195.TP
196.BI \-S " logical-sector-size"
197Specify the number of bytes per logical sector. Must be a power of 2
198and greater than or equal to 512, i.e. 512, 1024, 2048, 4096, 8192,
19916384, or 32768.
200.TP
201.B \-v
202Verbose execution.
203.SH BUGS
204.B mkdosfs
205can not create boot-able file systems. This isn't as easy as you might
206think at first glance for various reasons and has been discussed a lot
207already.
208.B mkdosfs
209simply will not support it ;)
210.SH AUTHOR
211Dave Hudson - <dave@humbug.demon.co.uk>; modified by Peter Anvin
212<hpa@yggdrasil.com>. Fixes and additions by Roman Hodek
213<roman@hodek.net> for Debian/GNU Linux.
214.SH ACKNOWLEDGMENTS
215.B mkdosfs
216is based on code from
217.BR mke2fs
218(written by Remy Card - <card@masi.ibp.fr>) which is itself based on
219.BR mkfs
220(written by Linus Torvalds - <torvalds@cs.helsinki.fi>).
221.SH SEE ALSO
222.BR dosfsck (8),
223.BR dosfslabel (8),
224.BR mkfs (8)