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