import source from 3.0.10
[external/dosfstools.git] / man / mkdosfs.8
1 .\" -*- 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
78 is used to create an MS-DOS file system under Linux on a device (usually
79 a disk partition).
80 .I device
81 is the special file corresponding to the device (e.g /dev/hdXX).
82 .I block-count
83 is the number of blocks on the device.  If omitted,
84 .B mkdosfs
85 automatically determines the file system size.
86 .SH OPTIONS
87 .TP
88 .B \-a
89 Normally, for any filesystem except very small ones, \fBmkdosfs\fP
90 will align all the data structures to cluster size, to make sure that
91 as long as the partition is properly aligned, so will all the data
92 structures in the filesystem.  This option disables alignment; this
93 may provide a handful of additional clusters of storage at the expense
94 of a significant performance degradation on RAIDs, flash media or
95 large-sector hard disks.
96 .TP
97 .B \-A
98 Use 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
100 format. There are some differences when using Atari format: If not
101 directed otherwise by the user, \fBmkdosfs\fP will always use 2
102 sectors per cluster, since GEMDOS doesn't like other values very much.
103 It will also obey the maximum number of sectors GEMDOS can handle.
104 Larger file systems are managed by raising the logical sector size.
105 Under Atari format, an Atari-compatible serial number for the
106 file system is generated, and a 12 bit FAT is used only for file systems
107 that have one of the usual floppy sizes (720k, 1.2M, 1.44M, 2.88M), a
108 16 bit FAT otherwise. This can be overridden with the \fB\-F\fP
109 option. Some PC-specific boot sector fields aren't written, and a boot
110 message (option \fB\-m\fP) is ignored.
111 .TP
112 .BI \-b " sector-of-backup "
113 Selects the location of the backup boot sector for FAT32. Default
114 depends on number of reserved sectors, but usually is sector 6. The
115 backup must be within the range of reserved sectors.
116 .TP
117 .B \-c
118 Check the device for bad blocks before creating the file system.
119 .TP
120 .B \-C
121 Create the file given as \fIdevice\fP on the command line, and write
122 the to-be-created file system to it. This can be used to create the
123 new file system in a file instead of on a real device, and to avoid
124 using \fBdd\fP in advance to create a file of appropriate size. With
125 this option, the \fIblock-count\fP must be given, because otherwise
126 the intended size of the file system wouldn't be known. The file
127 created is a sparse file, which actually only contains the meta-data
128 areas (boot sector, FATs, and root directory). The data portions won't
129 be stored on the disk, but the file nevertheless will have the
130 correct size. The resulting file can be copied later to a floppy disk
131 or other device, or mounted through a loop device.
132 .TP
133 .BI \-f " number-of-FATs"
134 Specify the number of file allocation tables in the file system.  The
135 default is 2.  Currently the Linux MS-DOS file system does not support
136 more than 2 FATs.
137 .TP
138 .BI \-F " FAT-size"
139 Specifies the type of file allocation tables used (12, 16 or 32 bit).
140 If nothing is specified, \fBmkdosfs\fR will automatically select
141 between 12, 16 and 32 bit, whatever fits better for the file system size.
142 .TP
143 .BI \-h " number-of-hidden-sectors "
144 Select the number of hidden sectors in the volume. Apparently some
145 digital cameras get indigestion if you feed them a CF card without
146 such 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"
150 Sets the volume ID of the newly created file system;
151 .I volume-id
152 is a 32-bit hexadecimal number (for example, 2e24ec82).  The default
153 is a number which depends on the file system creation time.
154 .TP
155 .B \-I
156 It is typical for fixed disk devices to be partitioned so, by default, you are
157 not permitted to create a filesystem across the entire device.
158 .B mkdosfs
159 will complain and tell you that it refuses to work.  This is different
160 when using MO disks.  One doesn't always need partitions on MO disks.
161 The file system can go directly to the whole disk.  Under other OSes
162 this is known as the 'superfloppy' format.
163
164 This switch will force
165 .B mkdosfs
166 to work properly.
167 .TP
168 .BI \-l " filename"
169 Read the bad blocks list from
170 .IR filename .
171 .TP
172 .BI \-m " message-file"
173 Sets the message the user receives on attempts to boot this file system
174 without having properly installed an operating system.  The message
175 file must not exceed 418 bytes once line feeds have been converted to
176 carriage return-line feed combinations, and tabs have been expanded.
177 If the filename is a hyphen (-), the text is taken from standard input.
178 .TP
179 .BI \-n " volume-name"
180 Sets the volume name (label) of the file system.  The volume name can
181 be up to 11 characters long.  The default is no label.
182 .TP
183 .BI \-r " root-dir-entries"
184 Select the number of entries available in the root directory.  The
185 default is 112 or 224 for floppies and 512 for hard disks.
186 .TP
187 .BI \-R " number-of-reserved-sectors "
188 Select the number of reserved sectors. With FAT32 format at least 2
189 reserved sectors are needed, the default is 32. Otherwise the default
190 is 1 (only the boot sector).
191 .TP
192 .BI \-s " sectors-per-cluster"
193 Specify the number of disk sectors per cluster.  Must be a power of 2,
194 i.e. 1, 2, 4, 8, ... 128.
195 .TP
196 .BI \-S " logical-sector-size"
197 Specify the number of bytes per logical sector.  Must be a power of 2
198 and greater than or equal to 512, i.e. 512, 1024, 2048, 4096, 8192,
199 16384, or 32768.
200 .TP
201 .B \-v
202 Verbose execution.
203 .SH BUGS
204 .B mkdosfs
205 can not create boot-able file systems. This isn't as easy as you might
206 think at first glance for various reasons and has been discussed a lot
207 already.
208 .B mkdosfs
209 simply will not support it ;)
210 .SH AUTHOR
211 Dave 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
216 is 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)