Imported Upstream version 4.0.18
[platform/upstream/mtools.git] / mtools.5
1 '\" t
2 .TH mtools 5 "09Jan13" MTOOLS MTOOLS
3 .SH Name
4 mtools.conf - mtools configuration files
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 .ds St Mtools\ 4.0.18
17 .oh '\\*(St''%'
18 .eh '%''\\*(St'
19 .PP
20 .SH Description
21 .PP
22 This manual page describes the configuration files for mtools. They 
23 are called \fR\&\f(CW\(if/etc/mtools.conf\(is\fR and \fR\&\f(CW\(if~/.mtoolsrc\(is\fR. If
24 the environmental variable \fR\&\f(CWMTOOLSRC\fR is set, its contents is used
25 as the filename for a third configuration file. These configuration
26 files describe the following items:
27 .TP
28 * \ Global\ configuration\ flags\ and\ variables\ 
29 .TP
30 * \ Per\ drive\ flags\ and\ variables\ 
31 .PP
32 .SS Location\ of\ the\ configuration\ files
33 .PP
34 .PP
35 \&\fR\&\f(CW\(if/etc/mtools.conf\(is\fR is the system-wide configuration file,
36 and \fR\&\f(CW\(if~/.mtoolsrc\(is\fR is the user's private configuration file.
37 .PP
38 On some systems, the system-wide configuration file is called
39 \&\fR\&\f(CW\(if/etc/default/mtools.conf\(is\fR instead.
40 .PP
41 .SS \ \ General\ configuration\ file\ syntax
42 .PP
43 The configuration files is made up of sections. Each section starts
44 with a keyword identifying the section followed by a colon.
45 Then follow variable assignments and flags. Variable assignments take
46 the following form:
47 .ft I
48 .nf
49 name=value
50 .fi
51 .ft R
52  
53 Flags are lone keywords without an equal sign and value following
54 them.  A section either ends at the end of the file or where the next
55 section begins.
56 .PP
57 Lines starting with a hash (\fR\&\f(CW#\fR) are comments. Newline characters
58 are equivalent to whitespace (except where ending a comment). The
59 configuration file is case insensitive, except for item enclosed in
60 quotes (such as filenames).
61 .PP
62 .SS Default\ values
63 For most platforms, mtools contains reasonable compiled-in defaults for
64 physical floppy drives.  Thus, you usually don't need to bother with the
65 configuration file, if all you want to do with mtools is to access your
66 floppy drives. On the other hand, the configuration file is needed if
67 you also want to use mtools to access your hard disk partitions and
68 DOSEMU image files.
69 .PP
70 .SS Global\ variables
71 .PP
72 Global flags may be set to 1 or to 0.
73 .PP
74 The following global flags are recognized:
75 .TP
76 \&\fR\&\f(CWMTOOLS_SKIP_CHECK\fR\ 
77 If this is set to 1, mtools skips most of its sanity checks. This is
78 needed to read some Atari disks which have been made with the earlier
79 ROMs, and which would not be recognized otherwise.
80 .TP
81 \&\fR\&\f(CWMTOOLS_FAT_COMPATIBILITY\fR\ 
82 If this is set to 1, mtools skips the fat size checks. Some disks have
83 a bigger FAT than they really need to. These are rejected if this
84 option is not set.
85 .TP
86 \&\fR\&\f(CWMTOOLS_LOWER_CASE\fR\ 
87 If this is set to 1, mtools displays all-upper-case short filenames as
88 lowercase. This has been done to allow a behavior which is consistent
89 with older versions of mtools which didn't know about the case bits.
90 .TP
91 \&\fR\&\f(CWMTOOLS_NO_VFAT\fR\ 
92 If this is set to 1, mtools won't generate VFAT entries for filenames
93 which are mixed-case, but otherwise legal dos filenames.  This is useful
94 when working with DOS versions which can't grok VFAT long names, such as
95 FreeDOS.
96 .TP
97 \&\fR\&\f(CWMTOOLS_DOTTED_DIR\fR\ 
98 In a wide directory, prints the short name with a dot instead of spaces
99 separating the basename and the extension.
100 .TP
101 \&\fR\&\f(CWMTOOLS_NAME_NUMERIC_TAIL\fR\ 
102 If this is set to one (default), generate numeric tails for all long
103 names (~1).  If set to zero, only generate numeric tails if otherwise a
104 clash would have happened.
105 .TP
106 \&\fR\&\f(CWMTOOLS_TWENTY_FOUR_HOUR_CLOCK\fR\ 
107 If 1, uses the European notation for times (twenty four hour clock),
108 else uses the UK/US notation (am/pm)
109 .PP
110 Example:
111 Inserting the following line into your configuration file instructs
112 mtools to skip the sanity checks:
113  
114 .nf
115 .ft 3
116 .in +0.3i
117   MTOOLS_SKIP_CHECK=1
118 .fi
119 .in -0.3i
120 .ft R
121 .PP
122  
123 \&\fR
124 .PP
125 Global variables may also be set via the environment:
126  
127 .nf
128 .ft 3
129 .in +0.3i
130   export MTOOLS_SKIP_CHECK=1
131 .fi
132 .in -0.3i
133 .ft R
134 .PP
135  
136 \&\fR
137 .PP
138 Global string variables may be set to any value:
139 .TP
140 \&\fR\&\f(CWMTOOLS_DATE_STRING\fR\ 
141 The format used for printing dates of files.  By default, is dd-mm-yyyy.
142 .PP
143 .SS Per\ drive\ flags\ and\ variables
144 .PP
145 .SS \ \ General\ information
146 .PP
147 Per drive flags and values may be described in a drive section. A
148 drive section starts with
149 \&\fR\&\f(CWdrive\fR "\fIdriveletter\fR" :
150 .PP
151 Then follow variable-value pairs and flags.
152 .PP
153 This is a sample drive description:
154  
155 .nf
156 .ft 3
157 .in +0.3i
158   drive a:
159     file="/dev/fd0" use_xdf=1
160 .fi
161 .in -0.3i
162 .ft R
163 .PP
164  
165 \&\fR
166 .PP
167 .SS \ \ Location\ information
168 .PP
169 For each drive, you need to describe where its data is physically
170 stored (image file, physical device, partition, offset).
171 .TP
172 \&\fR\&\f(CWfile\fR\ 
173 The name of the file or device holding the disk image. This is
174 mandatory. The file name should be enclosed in quotes.
175 .TP
176 \&\fR\&\f(CWpartition\fR\ 
177 Tells mtools to treat the drive as a partitioned device, and to use the
178 given partition. Only primary partitions are accessible using this
179 method, and they are numbered from 1 to 4. For logical partitions, use
180 the more general \fR\&\f(CWoffset\fR variable. The \fR\&\f(CWpartition\fR variable
181 is intended for removable media such as Syquest disks, ZIP drives, and
182 magneto-optical disks. Although traditional DOS sees Syquest disks and
183 magneto-optical disks as \fR\&\f(CW\(ifgiant floppy disks\(is\fR which are
184 unpartitioned, OS/2 and Windows NT treat them like hard disks,
185 i.e. partitioned devices. The \fR\&\f(CWpartition\fR flag is also useful DOSEMU
186 hdimages. It is not recommended for hard disks for which direct access
187 to partitions is available through mounting.
188 .TP
189 \&\fR\&\f(CWoffset\fR\ 
190 Describes where in the file the MS-DOS file system starts. This is useful
191 for logical partitions in DOSEMU hdimages, and for ATARI ram disks. By
192 default, this is zero, meaning that the file system starts right at the
193 beginning of the device or file.
194 .PP
195 .SS \ \ Disk\ Geometry\ Configuration
196 .PP
197 Geometry information describes the physical characteristics about the
198 disk. Its has three purposes:
199 .TP
200 formatting\ 
201 The geometry information is written into the boot sector of the newly
202 made disk. However, you may also describe the geometry information on
203 the command line. See section mformat, for details.
204 .TP
205 filtering\ 
206 On some Unixes there are device nodes which only support one physical
207 geometry. For instance, you might need a different node to access a disk
208 as high density or as low density. The geometry is compared to the
209 actual geometry stored on the boot sector to make sure that this device
210 node is able to correctly read the disk. If the geometry doesn't match,
211 this drive entry fails, and the next drive entry bearing the same drive
212 letter is tried. See section multiple descriptions, for more details on
213 supplying several descriptions for one drive letter.
214 .IP
215 If no geometry information is supplied in the configuration file, all
216 disks are accepted. On Linux (and on SPARC) there exist device nodes
217 with configurable geometry (\fR\&\f(CW\(if/dev/fd0\(is\fR, \fR\&\f(CW\(if/dev/fd1\(is\fR etc),
218 and thus filtering is not needed (and ignored) for disk drives.  (Mtools
219 still does do filtering on plain files (disk images) in Linux: this is
220 mainly intended for test purposes, as I don't have access to a Unix
221 which would actually need filtering).
222 .IP
223 If you do not need filtering, but want still a default geometry for
224 mformatting, you may switch off filtering using the \fR\&\f(CWmformat_only\fR
225 flag.
226 .IP
227 If you want filtering, you should supply the \fR\&\f(CWfilter\fR flag.  If you 
228 supply a geometry, you must supply one of both flags.
229 .TP
230 initial\ geometry\ 
231 On devices that support it (usually floppy devices), the geometry
232 information is also used to set the initial geometry. This initial
233 geometry is applied while reading the boot sector, which contains the
234 real geometry.  If no geometry information is supplied in the
235 configuration file, or if the \fR\&\f(CWmformat_only\fR flag is supplied, no
236 initial configuration is done.
237 .IP
238 On Linux, initial geometry is not really needed, as the configurable
239 devices are able to auto-detect the disk type accurately enough (for
240 most common formats) to read the boot sector.
241 .PP
242 Wrong geometry information may lead to very bizarre errors. That's why I
243 strongly recommend that you add the \fR\&\f(CWmformat_only\fR flag to your
244 drive description, unless you really need filtering or initial geometry.
245 .PP
246 The following geometry related variables are available:
247 .TP
248 \&\fR\&\f(CWcylinders\fR\ 
249 .TQ
250 \&\fR\&\f(CWtracks\fR
251 The number of cylinders. (\fR\&\f(CWcylinders\fR is the preferred form,
252 \&\fR\&\f(CWtracks\fR is considered obsolete)
253 .TP
254 \&\fR\&\f(CWheads\fR\ 
255 The number of heads (sides).
256 .TP
257 \&\fR\&\f(CWsectors\fR\ 
258 The number of sectors per track.
259 .PP
260 Example: the following drive section describes a 1.44M drive:
261 .PP
262  
263 .nf
264 .ft 3
265 .in +0.3i
266   drive a:
267       file="/dev/fd0H1440"
268       fat_bits=12
269       cylinders=80 heads=2 sectors=18
270       mformat_only
271 .fi
272 .in -0.3i
273 .ft R
274 .PP
275  
276 \&\fR
277 .PP
278 The following shorthand geometry descriptions are available:
279 .TP
280 \&\fR\&\f(CW1.44m\fR\ 
281 high density 3 1/2 disk. Equivalent to:
282 \&\fR\&\f(CWfat_bits=12 cylinders=80 heads=2 sectors=18\fR
283 .TP
284 \&\fR\&\f(CW1.2m\fR\ 
285 high density 5 1/4 disk. Equivalent to:
286 \&\fR\&\f(CWfat_bits=12 cylinders=80 heads=2 sectors=15\fR
287 .TP
288 \&\fR\&\f(CW720k\fR\ 
289 double density 3 1/2 disk. Equivalent to:
290 \&\fR\&\f(CWfat_bits=12 cylinders=80 heads=2 sectors=9\fR
291 .TP
292 \&\fR\&\f(CW360k\fR\ 
293 double density 5 1/4 disk. Equivalent to:
294 \&\fR\&\f(CWfat_bits=12 cylinders=40 heads=2 sectors=9\fR
295 .PP
296 The shorthand format descriptions may be amended. For example,
297 \&\fR\&\f(CW360k sectors=8\fR
298 describes a 320k disk and is equivalent to:
299 \&\fR\&\f(CWfat_bits=12 cylinders=40 heads=2 sectors=8\fR
300 .PP
301 .SS \ \ Open\ Flags
302 .PP
303 Moreover, the following flags are available:
304 .TP
305 \&\fR\&\f(CWsync\fR\ 
306 All i/o operations are done synchronously
307 .TP
308 \&\fR\&\f(CWnodelay\fR\ 
309 The device or file is opened with the O_NDELAY flag. This is needed on
310 some non-Linux architectures.
311 .TP
312 \&\fR\&\f(CWexclusive\fR\ 
313 The device or file is opened with the O_EXCL flag. On Linux, this
314 ensures exclusive access to the floppy drive. On most other
315 architectures, and for plain files it has no effect at all.
316 .PP
317 .SS \ \ General\ Purpose\ Drive\ Variables
318 .PP
319 The following general purpose drive variables are available.  Depending
320 to their type, these variables can be set to a string (precmd) or
321 an integer (all others)
322 .TP
323 \&\fR\&\f(CWfat_bits\fR\ 
324 The number of FAT bits. This may be 12 or 16. This is very rarely
325 needed, as it can almost always be deduced from information in the
326 boot sector. On the contrary, describing the number of fat bits may
327 actually be harmful if you get it wrong. You should only use it if
328 mtools gets the auto-detected number of fat bits wrong, or if you want
329 to mformat a disk with a weird number of fat bits.
330 .TP
331 \&\fR\&\f(CWcodepage\fR\ 
332 Describes the DOS code page used for short filenames. This is a number
333 between 1 and 999. By default, code page 850 is used. The reason for
334 this is because this code page contains most of the characters that are
335 also available in ISO-Latin-1. You may also specify a global code page
336 for all drives by using the global \fR\&\f(CWdefault_codepage\fR parameter
337 (outside of any drive description). This parameters exists starting at
338 version 4.0.0
339 .TP
340 \&\fR\&\f(CWprecmd\fR\ 
341 On some variants of Solaris, it is necessary to call 'volcheck -v'
342 before opening a floppy device, in order for the system to notice that
343 there is indeed a disk in the drive. \fR\&\f(CWprecmd="volcheck -v"\fR in the
344 drive clause establishes the desired behavior.
345 .TP
346 \&\fR\&\f(CWblocksize\fR\ 
347 This parameter represents a default block size to be always used on this
348 device.  All I/O is done with multiples of this block size,
349 independently of the sector size registered in the file system's boot
350 sector.  This is useful for character devices whose sector size is not
351 512, such as for example CD-ROM drives on Solaris.
352 .PP
353 Only the \fR\&\f(CWfile\fR variable is mandatory. The other parameters may
354 be left out. In that case a default value or an auto-detected value is
355 used.
356 .PP
357 .SS \ \ General\ Purpose\ Drive\ Flags
358 .PP
359 A flag can either be set to 1 (enabled) or 0 (disabled). If the value is
360 omitted, it is enabled.  For example, \fR\&\f(CWscsi\fR is equivalent to
361 \&\fR\&\f(CWscsi=1\fR
362 .TP
363 \&\fR\&\f(CWnolock\fR\ 
364 Instruct mtools to not use locking on this drive.  This is needed on
365 systems with buggy locking semantics.  However, enabling this makes
366 operation less safe in cases where several users may access the same
367 drive at the same time.
368 .TP
369 \&\fR\&\f(CWscsi\fR\ 
370 When set to 1, this option tells mtools to use raw SCSI I/O instead of
371 the standard read/write calls to access the device. Currently, this is
372 supported on HP-UX, Solaris and SunOS.  This is needed because on some
373 architectures, such as SunOS or Solaris, PC media can't be accessed
374 using the \fR\&\f(CWread\fR and \fR\&\f(CWwrite\fR system calls, because the OS expects
375 them to contain a Sun specific "disk label".
376 .IP
377 As raw SCSI access always uses the whole device, you need to specify the
378 "partition" flag in addition
379 .IP
380 On some architectures, such as Solaris, mtools needs root privileges to
381 be able to use the \fR\&\f(CWscsi\fR option.  Thus mtools should be installed
382 setuid root on Solaris if you want to access Zip/Jaz drives.  Thus, if
383 the \fR\&\f(CWscsi\fR flag is given, \fR\&\f(CWprivileged\fR is automatically
384 implied, unless explicitly disabled by \fR\&\f(CWprivileged=0\fR
385 .IP
386 Mtools uses its root privileges to open the device, and to issue the
387 actual SCSI I/O calls.  Moreover, root privileges are only used for
388 drives described in a system-wide configuration file such as
389 \&\fR\&\f(CW\(if/etc/mtools.conf\(is\fR, and not for those described in
390 \&\fR\&\f(CW\(if~/.mtoolsrc\(is\fR or \fR\&\f(CW\(if$MTOOLSRC\(is\fR.  
391 .TP
392 \&\fR\&\f(CWprivileged\fR\ 
393 When set to 1, this instructs mtools to use its setuid and setgid
394 privileges for opening the given drive.  This option is only valid for
395 drives described in the system-wide configuration files (such as
396 \&\fR\&\f(CW\(if/etc/mtools.conf\(is\fR, not \fR\&\f(CW\(if~/.mtoolsrc\(is\fR or
397 \&\fR\&\f(CW\(if$MTOOLSRC\(is\fR).  Obviously, this option is also a no op if mtools is
398 not installed setuid or setgid.  This option is implied by 'scsi=1', but
399 again only for drives defined in system-wide configuration files.
400 Privileged may also be set explicitly to 0, in order to tell mtools not
401 to use its privileges for a given drive even if \fR\&\f(CWscsi=1\fR is set.
402 .IP
403 Mtools only needs to be installed setuid if you use the
404 \&\fR\&\f(CWprivileged\fR or \fR\&\f(CWscsi\fR drive variables.  If you do not use
405 these options, mtools works perfectly well even when not installed
406 setuid root.
407 .TP
408 \&\fR\&\f(CWvold\fR\ 
409 .IP
410 Instructs mtools to interpret the device name as a vold identifier
411 rather than as a filename.  The vold identifier is translated into a
412 real filename using the \fR\&\f(CWmedia_findname()\fR and
413 \&\fR\&\f(CWmedia_oldaliases()\fR functions of the \fR\&\f(CWvolmgt\fR library.  This
414 flag is only available if you configured mtools with the
415 \&\fR\&\f(CW--enable-new-vold\fR option before compilation.
416 .TP
417 \&\fR\&\f(CWswap\fR\ 
418 .IP
419 Consider the media as a word-swapped Atari disk.
420 .TP
421 \&\fR\&\f(CWuse_xdf\fR\ 
422 If this is set to a non-zero value, mtools also tries to access this
423 disk as an XDF disk. XDF is a high capacity format used by OS/2. This
424 is off by default. See section XDF, for more details.
425 .TP
426 \&\fR\&\f(CWmformat_only\fR\ 
427 Tells mtools to use the geometry for this drive only for mformatting and 
428 not for filtering.
429 .TP
430 \&\fR\&\f(CWfilter\fR\ 
431 Tells mtools to use the geometry for this drive both for mformatting and 
432 filtering.
433 .TP
434 \&\fR\&\f(CWremote\fR\ 
435 Tells mtools to connect to floppyd (see section  floppyd).
436 .PP
437 .SS \ \ Supplying\ multiple\ descriptions\ for\ a\ drive
438 .PP
439 It is possible to supply multiple descriptions for a drive. In that
440 case, the descriptions are tried in order until one is found that
441 fits. Descriptions may fail for several reasons:
442 .TP
443 1.\ 
444 because the geometry is not appropriate,
445 .TP
446 2.\ 
447 because there is no disk in the drive,
448 .TP
449 3.\ 
450 or because of other problems.
451 .PP
452 Multiple definitions are useful when using physical devices which are
453 only able to support one single disk geometry.
454 Example:
455  
456 .nf
457 .ft 3
458 .in +0.3i
459   drive a: file="/dev/fd0H1440" 1.44m
460   drive a: file="/dev/fd0H720" 720k
461 .fi
462 .in -0.3i
463 .ft R
464 .PP
465  
466 \&\fR
467 .PP
468 This instructs mtools to use /dev/fd0H1440 for 1.44m (high density)
469 disks and /dev/fd0H720 for 720k (double density) disks. On Linux, this
470 feature is not really needed, as the /dev/fd0 device is able to handle
471 any geometry.
472 .PP
473 You may also use multiple drive descriptions to access both of your
474 physical drives through one drive letter:
475 .PP
476  
477 .nf
478 .ft 3
479 .in +0.3i
480   drive z: file="/dev/fd0"
481   drive z: file="/dev/fd1"
482 .fi
483 .in -0.3i
484 .ft R
485 .PP
486  
487 \&\fR
488 .PP
489 With this description, \fR\&\f(CWmdir z:\fR accesses your first physical
490 drive if it contains a disk. If the first drive doesn't contain a disk,
491 mtools checks the second drive.
492 .PP
493 When using multiple configuration files, drive descriptions in the files
494 parsed last override descriptions for the same drive in earlier
495 files. In order to avoid this, use the \fR\&\f(CWdrive+\fR or \fR\&\f(CW+drive\fR
496 keywords instead of \fR\&\f(CWdrive\fR. The first adds a description to the
497 end of the list (i.e. it will be tried last), and the first adds it to
498 the start of the list.
499 .PP
500 .SS Location\ of\ configuration\ files\ and\ parsing\ order
501 .PP
502 The configuration files are parsed in the following order:
503 .TP
504 1.\ 
505 compiled-in defaults
506 .TP
507 2.\ 
508 \&\fR\&\f(CW\(if/etc/mtools.conf\(is\fR
509 .TP
510 3.\ 
511 \&\fR\&\f(CW\(if~/.mtoolsrc\(is\fR.
512 .TP
513 4.\ 
514 \&\fR\&\f(CW\(if$MTOOLSRC\(is\fR (file pointed by the \fR\&\f(CWMTOOLSRC\fR environmental
515 variable)
516 .PP
517 Options described in the later files override those described in the
518 earlier files. Drives defined in earlier files persist if they are not
519 overridden in the later files. For instance, drives A and B may be
520 defined in \fR\&\f(CW\(if/etc/mtools.conf\(is\fR and drives C and D may be
521 defined in \fR\&\f(CW\(if~/.mtoolsrc\(is\fR However, if \fR\&\f(CW\(if~/.mtoolsrc\(is\fR also
522 defines drive A, this new description would override the description of
523 drive A in \fR\&\f(CW\(if/etc/mtools.conf\(is\fR instead of adding to it. If
524 you want to add a new description to a drive already described in an
525 earlier file, you need to use either the \fR\&\f(CW+drive\fR or \fR\&\f(CWdrive+\fR
526 keyword.
527 .PP
528 .SS Backwards\ compatibility\ with\ old\ configuration\ file\ syntax
529 .PP
530 The syntax described herein is new for version \fR\&\f(CWmtools-3.0\fR. The
531 old line-oriented syntax is still supported. Each line beginning with a
532 single letter is considered to be a drive description using the old
533 syntax. Old style and new style drive sections may be mixed within the
534 same configuration file, in order to make upgrading easier. Support for
535 the old syntax will be phased out eventually, and in order to discourage
536 its use, I purposefully omit its description here.
537 .PP
538 .SH See also
539 mtools