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