blob: 89fd43a7568d24ac0ae0d52b5a26d77fc7fd2e23 [file] [log] [blame]
Alistair Delvabeaee832021-02-24 11:27:23 -08001'\" t
2.TH mformat 1 "28Nov20" mtools-4.0.26
3.SH Name
4mformat - add an MSDOS filesystem to a low-level formatted floppy disk
5'\" t
6.de TQ
7.br
8.ns
9.TP \\$1
10..
11
12.tr \(is'
13.tr \(if`
14.tr \(pd"
15
16.SH Note\ of\ warning
17This manpage has been automatically generated from mtools's texinfo
18documentation, and may not be entirely accurate or complete. See the
19end of this man page for details.
20.PP
21.SH Description
22.PP
23The \fR\&\f(CWmformat\fR command is used to add an MS-DOS file system to a
24low-level formatted diskette. Its syntax is:
25.PP
26.ft I
27.nf
28\&\fR\&\f(CWmformat\fR [\fR\&\f(CW-t\fR \fIcylinders\fR|\fR\&\f(CW-T\fR \fItot_sectors\fR] [\fR\&\f(CW-h\fR \fIheads\fR] [\fR\&\f(CW-s\fR \fIsectors\fR]
29 [\fR\&\f(CW-f\fR \fIsize\fR] [\fR\&\f(CW-1\fR] [\fR\&\f(CW-4\fR] [\fR\&\f(CW-8\fR]
30 [\fR\&\f(CW-v\fR \fIvolume_label\fR]
31 [\fR\&\f(CW-F\fR] [\fR\&\f(CW-S\fR \fIsizecode\fR]
32 [\fR\&\f(CW-M\fR \fIsoftware_sector_size\fR]
33 [\fR\&\f(CW-N\fR \fIserial_number\fR] [\fR\&\f(CW-a\fR]
34 [\fR\&\f(CW-C\fR] [\fR\&\f(CW-H\fR \fIhidden_sectors\fR] [\fR\&\f(CW-I\fR \fIfsVersion\fR]
35 [\fR\&\f(CW-r\fR \fIroot_sectors\fR] [\fR\&\f(CW-L\fR \fIfat_len\fR]
36 [\fR\&\f(CW-B\fR \fIboot_sector\fR] [\fR\&\f(CW-k\fR]
37 [\fR\&\f(CW-m\fR \fImedia_descriptor\fR]
38 [\fR\&\f(CW-K\fR \fIbackup_boot\fR]
39 [\fR\&\f(CW-R\fR \fInb_reserved_sectors\fR]
40 [\fR\&\f(CW-c\fR \fIclusters_per_sector\fR]
41 [\fR\&\f(CW-d\fR \fIfat_copies\fR]
42 [\fR\&\f(CW-X\fR] [\fR\&\f(CW-2\fR \fIsectors_on_track_0\fR] [\fR\&\f(CW-3\fR]
43 [\fR\&\f(CW-0\fR \fIrate_on_track_0\fR] [\fR\&\f(CW-A\fR \fIrate_on_other_tracks\fR]
44 \fIdrive:\fR
45.fi
46.ft R
47
48.PP
49\&\fR\&\f(CWMformat\fR adds a minimal MS-DOS file system (boot sector, FAT, and
50root directory) to a diskette that has already been formatted by a Unix
51low-level format.
52.PP
53The following options are supported: (The S, 2, 1 and M options may not
54exist if this copy of mtools has been compiled without the USE_2M
55option)
56.PP
57The following options are the same as for MS-DOS's format command:
58.PP
59.SH Options
60.TP
61\&\fR\&\f(CWv\fR\
62Specifies the volume label. A volume label identifies the disk and can
63be a maximum of 11 characters. If you omit the -v switch, mformat will
64assign no label to the disk.
65.TP
66\&\fR\&\f(CWf\fR\
67Specifies the size of the DOS file system to format. Only a certain
68number of predefined sizes are supported by this flag; for others use
69the -h/-t/-s flags. The following sizes are supported:
70.RS
71.TP
72160\
73160K, single-sided, 8 sectors per track, 40 cylinders (for 5 1/4 DD)
74.TP
75180\
76160K, single-sided, 9 sectors per track, 40 cylinders (for 5 1/4 DD)
77.TP
78320\
79320K, double-sided, 8 sectors per track, 40 cylinders (for 5 1/4 DD)
80.TP
81360\
82360K, double-sided, 9 sectors per track, 40 cylinders (for 5 1/4 DD)
83.TP
84720\
85720K, double-sided, 9 sectors per track, 80 cylinders (for 3 1/2 DD)
86.TP
871200\
881200K, double-sided, 15 sectors per track, 80 cylinders (for 5 1/4 HD)
89.TP
901440\
911440K, double-sided, 18 sectors per track, 80 cylinders (for 3 1/2 HD)
92.TP
932880\
942880K, double-sided, 36 sectors per track, 80 cylinders (for 3 1/2 ED)
95.RE
96.TP
97\&\fR\&\f(CWt\fR\
98Specifies the number of tracks on the disk.
99.TP
100\&\fR\&\f(CWT\fR\
101Specifies the number of total sectors on the disk. Only one of these 2
102options may be specified (tracks or total sectors)
103.TP
104\&\fR\&\f(CWh\fR\
105The number of heads (sides).
106.TP
107\&\fR\&\f(CWs\fR\
108Specifies the number of sectors per track. If the 2m option is given,
109number of 512-byte sector equivalents on generic tracks (i.e. not head 0
110track 0). If the 2m option is not given, number of physical sectors per
111track (which may be bigger than 512 bytes).
112.TP
113\&\fR\&\f(CW1\fR\
114Formats a single side (equivalent to -h 1)
115.TP
116\&\fR\&\f(CW4\fR\
117Formats a 360K double-sided disk (equivalent to -f 360). When used
118together with -the 1 switch, this switch formats a 180K disk
119.TP
120\&\fR\&\f(CW8\fR\
121Formats a disk with 8 sectors per track.
122.PP
123MS-DOS format's \fR\&\f(CWq\fR, \fR\&\f(CWu\fR and \fR\&\f(CWb\fR options are not
124supported, and \fR\&\f(CWs\fR has a different meaning.
125.PP
126The following options are specific to mtools:
127.IP
128.TP
129\&\fR\&\f(CWF\fR\
130Format the partition as FAT32.
131.TP
132\&\fR\&\f(CWS\fR\
133The size code. The size of the sector is 2 ^ (sizecode + 7).
134.TP
135\&\fR\&\f(CWX\fR\
136formats the disk as an XDF disk. See section XDF, for more details. The disk
137has first to be low-level formatted using the xdfcopy utility included
138in the fdutils package. XDF disks are used for instance for OS/2 install
139disks.
140.TP
141\&\fR\&\f(CW2\fR\
1422m format. The parameter to this option describes the number of
143sectors on track 0, head 0. This option is recommended for sectors
144bigger than normal.
145.TP
146\&\fR\&\f(CW3\fR\
147don't use a 2m format, even if the current geometry of the disk is a 2m
148geometry.
149.TP
150\&\fR\&\f(CW0\fR\
151Data transfer rate on track 0
152.TP
153\&\fR\&\f(CWA\fR\
154Data transfer rate on tracks other than 0
155.TP
156\&\fR\&\f(CWM\fR\
157software sector size. This parameter describes the sector size in bytes used
158by the MS-DOS file system. By default it is the physical sector size.
159.TP
160\&\fR\&\f(CWN\fR\
161Uses the requested serial number, instead of generating one
162automatically
163.TP
164\&\fR\&\f(CWa\fR\
165If this option is given, an Atari style serial number is generated.
166Ataris store their serial number in the OEM label.
167.TP
168\&\fR\&\f(CWC\fR\
169creates the disk image file to install the MS-DOS file system on
170it. Obviously, this is useless on physical devices such as floppies
171and hard disk partitions, but is interesting for image files.
172.TP
173\&\fR\&\f(CWH\fR\
174number of hidden sectors. This parameter is useful for formatting hard
175disk partition, which are not aligned on track boundaries (i.e. first
176head of first track doesn't belong to the partition, but contains a
177partition table). In that case the number of hidden sectors is in
178general the number of sectors per cylinder. This is untested.
179.TP
180\&\fR\&\f(CWI\fR\
181Sets the fsVersion id when formatting a FAT32 drive. In order to find
182this out, run minfo on an existing FAT32 drive, and mail me about it, so
183I can include the correct value in future versions of mtools.
184.TP
185\&\fR\&\f(CWc\fR\
186Sets the size of a cluster (in sectors). If this cluster size would
187generate a FAT that too big for its number of bits, mtools automatically
188increases the cluster size, until the FAT is small enough. If no
189cluster size is specified explicitly, mtools uses a default value as
190described in section ``Number of sectors per cluster'' below.
191.TP
192\&\fR\&\f(CWd\fR\
193Sets the number of FAT copies. Default is 2. This setting can also be
194specified using the \fR\&\f(CWMTOOLS_NFATS\fR environment variable.
195.TP
196\&\fR\&\f(CWr\fR\
197Sets the size of the root directory (in sectors). Only applicable to 12
198and 16 bit FATs. This setting can also be specified using the
199\&\fR\&\f(CWMTOOLS_DIR_LEN\fR environment variable.
200.TP
201\&\fR\&\f(CWL\fR\
202Sets the length of the FAT.
203.TP
204\&\fR\&\f(CWB\fR\
205Use the boot sector stored in the given file or device, instead of using
206its own. Only the geometry fields are updated to match the target disks
207parameters.
208.TP
209\&\fR\&\f(CWk\fR\
210Keep the existing boot sector as much as possible. Only the geometry
211fields and other similar file system data are updated to match the target
212disks parameters.
213.TP
214\&\fR\&\f(CWK\fR\
215Sets the sector number where the backup of the boot sector should be
216stored (only relevant on FAT32).
217.TP
218\&\fR\&\f(CWR\fR\
219Sets the number of reserved sectors for this filesystem. This must be
220at least 1 for non-FAT32 disks, and at least 3 for FAT disks (in order
221to accommodate the boot sector, the info sector and the backup boot
222sector).
223.TP
224\&\fR\&\f(CWm\fR\
225Use a non-standard media descriptor byte for this disk. The media
226descriptor is stored at position 21 of the boot sector, and as first
227byte in each FAT copy. Using this option may confuse DOS or older mtools
228version, and may make the disk unreadable. Only use if you know what you
229are doing.
230.PP
231To format a diskette at a density other than the default, you must supply
232(at least) those command line parameters that are different from the
233default.
234.PP
235\&\fR\&\f(CWMformat\fR returns 0 on success or 1 on failure.
236.PP
237It doesn't record bad block information to the Fat, use
238\&\fR\&\f(CWmbadblocks\fR for that.
239.PP
240.SH Number\ of\ sectors\ per\ cluster
241.PP
242If the user indicates no cluster size, mformat figures out a default
243value for it.
244.PP
245For FAT32 it uses the following table to determine the number of
246sectors per cluster, depending on the total number of sectors on the
247filesystem.
248.PP
249more than 32*1024*1024*2: 64 sectors
250.br
251between 16*1024*1024*2 and 32*1024*1024*2: 32 sectors
252.br
253between 8*1024*1024*2 and 16*1024*1024*2: 16 sectors
254.br
255between 260*1024*2 and 81024*1024*2: 1 sectors
256.br
257.PP
258This is derived from information on page 20 of Microsoft's
259\&\fR\&\f(CWfatgen103\fR document, which currently can be found at the
260following address:
261.PP
262\&\fR\&\f(CWhttps://staff.washington.edu/dittrich/misc/fatgen103.pdf\fR
263.PP
264For FAT12 and FAT16, mformat uses an iterative approach, where it
265starts with a set value, which it doubles until it is able to fill up
266the disk using that cluster size and a number of cluster less than the
267maximum allowed.
268.PP
269The starting value is 1 for disks with one head or less than 2000
270sectors, and 2 for disks with more than one head, and more than 2000
271sectors.
272.PP
273The number of sectors per cluster cannot go beyond 128.
274.PP
275.SH See\ Also
276Mtools' texinfo doc
277.SH Viewing\ the\ texi\ doc
278This manpage has been automatically generated from mtools's texinfo
279documentation. However, this process is only approximative, and some
280items, such as crossreferences, footnotes and indices are lost in this
281translation process. Indeed, these items have no appropriate
282representation in the manpage format. Moreover, not all information has
283been translated into the manpage version. Thus I strongly advise you to
284use the original texinfo doc. See the end of this manpage for
285instructions how to view the texinfo doc.
286.TP
287* \ \
288To generate a printable copy from the texinfo doc, run the following
289commands:
290
291.nf
292.ft 3
293.in +0.3i
294 ./configure; make dvi; dvips mtools.dvi
295.fi
296.in -0.3i
297.ft R
298.PP
299
300\&\fR
301.TP
302* \ \
303To generate a html copy, run:
304
305.nf
306.ft 3
307.in +0.3i
308 ./configure; make html
309.fi
310.in -0.3i
311.ft R
312.PP
313
314\&\fRA premade html can be found at
315\&\fR\&\f(CW\(ifhttp://www.gnu.org/software/mtools/manual/mtools.html\(is\fR
316.TP
317* \ \
318To generate an info copy (browsable using emacs' info mode), run:
319
320.nf
321.ft 3
322.in +0.3i
323 ./configure; make info
324.fi
325.in -0.3i
326.ft R
327.PP
328
329\&\fR
330.PP
331The texinfo doc looks most pretty when printed or as html. Indeed, in
332the info version certain examples are difficult to read due to the
333quoting conventions used in info.
334.PP