2 .TH mtools 5 "09Jan13" MTOOLS MTOOLS
4 mtools.conf - mtools configuration files
22 This manual page describes the configuration files for mtools. They
23 are called \fR\&\f(CW\(ifSYSCONFDIRmtools.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:
28 * \ Global\ configuration\ flags\ and\ variables\
30 * \ Per\ drive\ flags\ and\ variables\
32 .SS Location\ of\ the\ configuration\ files
35 \&\fR\&\f(CW\(ifSYSCONFDIRmtools.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.
38 On some systems, the system-wide configuration file is called
39 \&\fR\&\f(CW\(if/etc/default/mtools.conf\(is\fR instead.
41 .SS \ \ General\ configuration\ file\ syntax
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
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
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).
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
72 Global flags may be set to 1 or to 0.
74 The following global flags are recognized:
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.
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
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.
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
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.
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.
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)
111 Inserting the following line into your configuration file instructs
112 mtools to skip the sanity checks:
125 Global variables may also be set via the environment:
130 export MTOOLS_SKIP_CHECK=1
138 Global string variables may be set to any value:
140 \&\fR\&\f(CWMTOOLS_DATE_STRING\fR\
141 The format used for printing dates of files. By default, is dd-mm-yyyy.
143 .SS Per\ drive\ flags\ and\ variables
145 .SS \ \ General\ information
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" :
151 Then follow variable-value pairs and flags.
153 This is a sample drive description:
159 file="/dev/fd0" use_xdf=1
167 .SS \ \ Location\ information
169 For each drive, you need to describe where its data is physically
170 stored (image file, physical device, partition, offset).
173 The name of the file or device holding the disk image. This is
174 mandatory. The file name should be enclosed in quotes.
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.
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.
195 .SS \ \ Disk\ Geometry\ Configuration
197 Geometry information describes the physical characteristics about the
198 disk. Its has three purposes:
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.
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.
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).
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
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.
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.
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.
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.
246 The following geometry related variables are available:
248 \&\fR\&\f(CWcylinders\fR\
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)
254 \&\fR\&\f(CWheads\fR\
255 The number of heads (sides).
257 \&\fR\&\f(CWsectors\fR\
258 The number of sectors per track.
260 Example: the following drive section describes a 1.44M drive:
269 cylinders=80 heads=2 sectors=18
278 The following shorthand geometry descriptions are available:
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
285 high density 5 1/4 disk. Equivalent to:
286 \&\fR\&\f(CWfat_bits=12 cylinders=80 heads=2 sectors=15\fR
289 double density 3 1/2 disk. Equivalent to:
290 \&\fR\&\f(CWfat_bits=12 cylinders=80 heads=2 sectors=9\fR
293 double density 5 1/4 disk. Equivalent to:
294 \&\fR\&\f(CWfat_bits=12 cylinders=40 heads=2 sectors=9\fR
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
303 Moreover, the following flags are available:
306 All i/o operations are done synchronously
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.
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.
317 .SS \ \ General\ Purpose\ Drive\ Variables
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)
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.
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
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.
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.
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
357 .SS \ \ General\ Purpose\ Drive\ Flags
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
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.
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".
377 As raw SCSI access always uses the whole device, you need to specify the
378 "partition" flag in addition
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
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\(ifSYSCONFDIRmtools.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.
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\(ifSYSCONFDIRmtools.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.
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
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.
419 Consider the media as a word-swapped Atari disk.
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.
426 \&\fR\&\f(CWmformat_only\fR\
427 Tells mtools to use the geometry for this drive only for mformatting and
430 \&\fR\&\f(CWfilter\fR\
431 Tells mtools to use the geometry for this drive both for mformatting and
434 \&\fR\&\f(CWremote\fR\
435 Tells mtools to connect to floppyd (see section floppyd).
437 .SS \ \ Supplying\ multiple\ descriptions\ for\ a\ drive
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:
444 because the geometry is not appropriate,
447 because there is no disk in the drive,
450 or because of other problems.
452 Multiple definitions are useful when using physical devices which are
453 only able to support one single disk geometry.
459 drive a: file="/dev/fd0H1440" 1.44m
460 drive a: file="/dev/fd0H720" 720k
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
473 You may also use multiple drive descriptions to access both of your
474 physical drives through one drive letter:
480 drive z: file="/dev/fd0"
481 drive z: file="/dev/fd1"
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.
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.
500 .SS Location\ of\ configuration\ files\ and\ parsing\ order
502 The configuration files are parsed in the following order:
508 \&\fR\&\f(CW\(ifSYSCONFDIRmtools.conf\(is\fR
511 \&\fR\&\f(CW\(if~/.mtoolsrc\(is\fR.
514 \&\fR\&\f(CW\(if$MTOOLSRC\(is\fR (file pointed by the \fR\&\f(CWMTOOLSRC\fR environmental
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\(ifSYSCONFDIRmtools.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\(ifSYSCONFDIRmtools.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
528 .SS Backwards\ compatibility\ with\ old\ configuration\ file\ syntax
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.