Header Ads Widget

[MAN] mtools

Content-type: text/html; charset=UTF-8 Man page of mtools

mtools

Section: User Commands (1)
Updated: 09Jan13
Index Return to Main Contents
 

Name

mtools - utilities to access DOS disks in Unix.

 

Introduction

Mtools is a collection of tools to allow Unix systems to manipulate MS-DOS files: read, write, and move around files on an MS-DOS file system (typically a floppy disk). Where reasonable, each program attempts to emulate the MS-DOS equivalent command. However, unnecessary restrictions and oddities of DOS are not emulated. For instance, it is possible to move subdirectories from one subdirectory to another.

Mtools is sufficient to give access to MS-DOS file systems. For instance, commands such as mdir a: work on the a: floppy without any preliminary mounting or initialization (assuming the default ∞/etc/mtools.confIntegral works on your machine). With mtools, one can change floppies too without unmounting and mounting.

 

Where to get mtools

Mtools can be found at the following places (and their mirrors):
 

http://ftp.gnu.org/gnu/mtools/mtools-4.0.18.tar.gz
http://mtools.linux.lu/mtools-4.0.18.tar.gz
ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.18.tar.gz
ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.18.tar.gz


 

Before reporting a bug, make sure that it has not yet been fixed in the Alpha patches which can be found at:
 

http://ftp.gnu.org/gnu/mtools/
http://mtools.linux.lu/
ftp://www.tux.org/pub/knaff/mtools


 

These patches are named mtools-version-ddmm.taz, where version stands for the base version, dd for the day and mm for the month. Due to a lack of space, I usually leave only the most recent patch.

There is an mtools mailing list at mtools @ tux.org . Please send all bug reports to this list. You may subscribe to the list by sending a message with 'subscribe mtools @ tux.org' in its body to majordomo @ tux.org . (N.B. Please remove the spaces around the "@" both times. I left them there in order to fool spambots.) Announcements of new mtools versions will also be sent to the list, in addition to the Linux announce newsgroups. The mailing list is archived at http://lists.gnu.org/pipermail/info-mtools/

 

Common features of all mtools commands

 

Options and filenames

MS-DOS filenames are composed of a drive letter followed by a colon, a subdirectory, and a filename. Only the filename part is mandatory, the drive letter and the subdirectory are optional. Filenames without a drive letter refer to Unix files. Subdirectory names can use either the '/' or '\' separator. The use of the '\' separator or wildcards requires the names to be enclosed in quotes to protect them from the shell. However, wildcards in Unix filenames should not be enclosed in quotes, because here we want the shell to expand them.

The regular expression "pattern matching" routines follow the Unix-style rules. For example, `*' matches all MS-DOS files in lieu of `*.*'. The archive, hidden, read-only and system attribute bits are ignored during pattern matching.

All options use the - (minus) as their first character, not / as you'd expect in MS-DOS.

Most mtools commands allow multiple filename parameters, which doesn't follow MS-DOS conventions, but which is more user-friendly.

Most mtools commands allow options that instruct them how to handle file name clashes. See section name clashes, for more details on these. All commands accept the -V flags which prints the version, and most accept the -v flag, which switches on verbose mode. In verbose mode, these commands print out the name of the MS-DOS files upon which they act, unless stated otherwise. See section Commands, for a description of the options which are specific to each command.

 

Drive letters

The meaning of the drive letters depends on the target architectures. However, on most target architectures, drive A is the first floppy drive, drive B is the second floppy drive (if available), drive J is a Jaz drive (if available), and drive Z is a Zip drive (if available). On those systems where the device name is derived from the SCSI id, the Jaz drive is assumed to be at SCSI target 4, and the Zip at SCSI target 5 (factory default settings). On Linux, both drives are assumed to be the second drive on the SCSI bus (/dev/sdb). The default settings can be changes using a configuration file (see section Configuration).

The drive letter : (colon) has a special meaning. It is used to access image files which are directly specified on the command line using the -i options.

Example:
 

 mcopy -i my-image-file.bin ::file1 ::file2 .


 

This copies file1 and file2 from the image file (my-image-file.bin) to the /tmp directory.

You can also supply an offset within the image file by including @@offset into the file name.

Example:
 

 mcopy -i my-image-file.bin@@1M ::file1 ::file2 .


 

This looks for the image at the offset of 1M in the file, rather than at its beginning.

 

Current working directory

The mcd command (∞mcdIntegral) is used to establish the device and the current working directory (relative to the MS-DOS file system), otherwise the default is assumed to be A:/. However, unlike MS-DOS, there is only one working directory for all drives, and not one per drive.

 

VFAT-style long file names

This version of mtools supports VFAT style long filenames. If a Unix filename is too long to fit in a short DOS name, it is stored as a VFAT long name, and a companion short name is generated. This short name is what you see when you examine the disk with a pre-7.0 version of DOS.
 The following table shows some examples of short names:


 

Long name       MS-DOS name     Reason for the change
---------       ----------      ---------------------
thisisatest     THISIS~1        filename too long
alain.knaff     ALAIN~1.KNA     extension too long
prn.txt         PRN~1.TXT       PRN is a device name
.abc            ABC~1           null filename
hot+cold        HOT_CO~1        illegal character


 


 As you see, the following transformations happen to derive a short name:

*   
Illegal characters are replaced by underscores. The illegal characters are ;+=[]',\"*\\<>/?:|.
*   
Extra dots, which cannot be interpreted as a main name/extension separator are removed
*   
A ~n number is generated,
*   
The name is shortened so as to fit in the 8+3 limitation


 The initial Unix-style file name (whether long or short) is also called the primary name, and the derived short name is also called the secondary name.


 Example:
 

 mcopy /etc/motd a:Reallylongname


  Mtools creates a VFAT entry for Reallylongname, and uses REALLYLO as a short name. Reallylongname is the primary name, and REALLYLO is the secondary name.
 

 mcopy /etc/motd a:motd


  Motd fits into the DOS filename limits. Mtools doesn't need to derivate another name. Motd is the primary name, and there is no secondary name.


 In a nutshell: The primary name is the long name, if one exists, or the short name if there is no long name.


 Although VFAT is much more flexible than FAT, there are still names that are not acceptable, even in VFAT. There are still some illegal characters left (\"*\\<>/?:|), and device names are still reserved.


 

Unix name       Long name       Reason for the change
---------       ----------      ---------------------
prn             prn-1           PRN is a device name
ab:c            ab_c-1          illegal character


 


 As you see, the following transformations happen if a long name is illegal:

*   
Illegal characters are replaces by underscores,
*   
A -n number is generated,

 

Name clashes

When writing a file to disk, its long name or short name may collide with an already existing file or directory. This may happen for all commands which create new directory entries, such as mcopy, mmd, mren, mmove. When a name clash happens, mtools asks you what it should do. It offers several choices:

overwrite 
Overwrites the existing file. It is not possible to overwrite a directory with a file.
rename 
Renames the newly created file. Mtools prompts for the new filename
autorename 
Renames the newly created file. Mtools chooses a name by itself, without prompting
skip 
Gives up on this file, and moves on to the next (if any)

To chose one of these actions, type its first letter at the prompt. If you use a lower case letter, the action only applies for this file only, if you use an upper case letter, the action applies to all files, and you won't be prompted again.

You may also chose actions (for all files) on the command line, when invoking mtools:

-D o 
Overwrites primary names by default.
-D O 
Overwrites secondary names by default.
-D r 
Renames primary name by default.
-D R 
Renames secondary name by default.
-D a 
Autorenames primary name by default.
-D A 
Autorenames secondary name by default.
-D s 
Skip primary name by default.
-D S 
Skip secondary name by default.
-D m 
Ask user what to do with primary name.
-D M 
Ask user what to do with secondary name.

Note that for command line switches lower/upper differentiates between primary/secondary name whereas for interactive choices, lower/upper differentiates between just-this-time/always.

The primary name is the name as displayed in Windows 95 or Windows NT: i.e. the long name if it exists, and the short name otherwise. The secondary name is the "hidden" name, i.e. the short name if a long name exists.

By default, the user is prompted if the primary name clashes, and the secondary name is autorenamed.

If a name clash occurs in a Unix directory, mtools only asks whether to overwrite the file, or to skip it.

 

Case sensitivity of the VFAT file system

The VFAT file system is able to remember the case of the filenames. However, filenames which differ only in case are not allowed to coexist in the same directory. For example if you store a file called LongFileName on a VFAT file system, mdir shows this file as LongFileName, and not as Longfilename. However, if you then try to add LongFilename to the same directory, it is refused, because case is ignored for clash checks.

The VFAT file system allows to store the case of a filename in the attribute byte, if all letters of the filename are the same case, and if all letters of the extension are the same case too. Mtools uses this information when displaying the files, and also to generate the Unix filename when mcopying to a Unix directory. This may have unexpected results when applied to files written using an pre-7.0 version of DOS: Indeed, the old style filenames map to all upper case. This is different from the behavior of the old version of mtools which used to generate lower case Unix filenames.

 

high capacity formats

Mtools supports a number of formats which allow to store more data on disk as usual. Due to different operating system abilities, these formats are not supported on all operating systems. Mtools recognizes these formats transparently where supported.

In order to format these disks, you need to use an operating system specific tool. For Linux, suitable floppy tools can be found in the fdutils package at the following locations~:
 

ftp://www.tux.org/pub/knaff/fdutils/.
ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/fdutils-*


 

See the manual pages included in that package for further detail: Use superformat to format all formats except XDF, and use xdfcopy to format XDF.

 

  More sectors

The oldest method of fitting more data on a disk is to use more sectors and more cylinders. Although the standard format uses 80 cylinders and 18 sectors (on a 3 1/2 high density disk), it is possible to use up to 83 cylinders (on most drives) and up to 21 sectors. This method allows to store up to 1743K on a 3 1/2 HD disk. However, 21 sector disks are twice as slow as the standard 18 sector disks because the sectors are packed so close together that we need to interleave them. This problem doesn't exist for 20 sector formats.

These formats are supported by numerous DOS shareware utilities such as fdformat and vgacopy. In his infinite hubris, Bill Gate$ believed that he invented this, and called it ∞DMF disksIntegral, or ∞Windows formatted disksIntegral. But in reality, it has already existed years before! Mtools supports these formats on Linux, on SunOS and on the DELL Unix PC.

 

  Bigger sectors

By using bigger sectors it is possible to go beyond the capacity which can be obtained by the standard 512-byte sectors. This is because of the sector header. The sector header has the same size, regardless of how many data bytes are in the sector. Thus, we save some space by using fewer, but bigger sectors. For example, 1 sector of 4K only takes up header space once, whereas 8 sectors of 512 bytes have also 8 headers, for the same amount of useful data.

This method allows to store up to 1992K on a 3 1/2 HD disk.

Mtools supports these formats only on Linux.

 

  2m

The 2m format was originally invented by Ciriaco Garcia de Celis. It also uses bigger sectors than usual in order to fit more data on the disk. However, it uses the standard format (18 sectors of 512 bytes each) on the first cylinder, in order to make these disks easier to handle by DOS. Indeed this method allows to have a standard sized boot sector, which contains a description of how the rest of the disk should be read.

However, the drawback of this is that the first cylinder can hold less data than the others. Unfortunately, DOS can only handle disks where each track contains the same amount of data. Thus 2m hides the fact that the first track contains less data by using a shadow FAT. (Usually, DOS stores the FAT in two identical copies, for additional safety. XDF stores only one copy, but tells DOS that it stores two. Thus the space that would be taken up by the second FAT copy is saved.) This also means that you should never use a 2m disk to store anything else than a DOS file system.

Mtools supports these formats only on Linux.

 

  XDF

XDF is a high capacity format used by OS/2. It can hold 1840 K per disk. That's lower than the best 2m formats, but its main advantage is that it is fast: 600 milliseconds per track. That's faster than the 21 sector format, and almost as fast as the standard 18 sector format. In order to access these disks, make sure mtools has been compiled with XDF support, and set the use_xdf variable for the drive in the configuration file. See section Compiling mtools, and ∞miscellaneous variablesIntegral, for details on how to do this. Fast XDF access is only available for Linux kernels which are more recent than 1.1.34.

Mtools supports this format only on Linux.

Caution / Attention distributors: If mtools is compiled on a Linux kernel more recent than 1.3.34, it won't run on an older kernel. However, if it has been compiled on an older kernel, it still runs on a newer kernel, except that XDF access is slower. It is recommended that distribution authors only include mtools binaries compiled on kernels older than 1.3.34 until 2.0 comes out. When 2.0 will be out, mtools binaries compiled on newer kernels may (and should) be distributed. Mtools binaries compiled on kernels older than 1.3.34 won't run on any 2.1 kernel or later.

 

Exit codes

All the Mtools commands return 0 on success, 1 on utter failure, or 2 on partial failure. All the Mtools commands perform a few sanity checks before going ahead, to make sure that the disk is indeed an MS-DOS disk (as opposed to, say an ext2 or MINIX disk). These checks may reject partially corrupted disks, which might otherwise still be readable. To avoid these checks, set the MTOOLS_SKIP_CHECK environmental variable or the corresponding configuration file variable (see section global variables)  

Bugs

An unfortunate side effect of not guessing the proper device (when multiple disk capacities are supported) is an occasional error message from the device driver. These can be safely ignored.

The fat checking code chokes on 1.72 Mb disks mformatted with pre-2.0.7 mtools. Set the environmental variable MTOOLS_FAT_COMPATIBILITY (or the corresponding configuration file variable, ∞global variablesIntegral) to bypass the fat checking.

 

See also

floppyd_installtest mattrib mbadblocks mcd mclasserase mcopy mdel mdeltree mdir mdu mformat minfo mkmanifest mlabel mmd mmount mmove mrd mren mshortname mshowfat mtoolstest mtype


 

Index

Name
Introduction
Where to get mtools
Common features of all mtools commands
Options and filenames
Drive letters
Current working directory
VFAT-style long file names
Name clashes
Case sensitivity of the VFAT file system
high capacity formats
  More sectors
  Bigger sectors
  2m
  XDF
Exit codes
Bugs
See also

This document was created by man2html, using the manual pages.
Time: 04:45:26 GMT, September 16, 2022 Content-type: text/html; charset=UTF-8 Man page of mtools

mtools

Section: MTOOLS (5)
Updated: 09Jan13
Index Return to Main Contents
 

Name

mtools.conf - mtools configuration files

 

Description

This manual page describes the configuration files for mtools. They are called ∞/etc/mtools.confIntegral and ∞~/.mtoolsrcIntegral. If the environmental variable MTOOLSRC is set, its contents is used as the filename for a third configuration file. These configuration files describe the following items:

*  Global configuration flags and variables 
*  Per drive flags and variables 

 

Location of the configuration files

∞/etc/mtools.confIntegral is the system-wide configuration file, and ∞~/.mtoolsrcIntegral is the user's private configuration file.

On some systems, the system-wide configuration file is called ∞/etc/default/mtools.confIntegral instead.

 

  General configuration file syntax

The configuration files is made up of sections. Each section starts with a keyword identifying the section followed by a colon. Then follow variable assignments and flags. Variable assignments take the following form:

name=value

  Flags are lone keywords without an equal sign and value following them. A section either ends at the end of the file or where the next section begins.

Lines starting with a hash (#) are comments. Newline characters are equivalent to whitespace (except where ending a comment). The configuration file is case insensitive, except for item enclosed in quotes (such as filenames).

 

Default values

For most platforms, mtools contains reasonable compiled-in defaults for physical floppy drives. Thus, you usually don't need to bother with the configuration file, if all you want to do with mtools is to access your floppy drives. On the other hand, the configuration file is needed if you also want to use mtools to access your hard disk partitions and DOSEMU image files.

 

Global variables

Global flags may be set to 1 or to 0.

The following global flags are recognized:

MTOOLS_SKIP_CHECK 
If this is set to 1, mtools skips most of its sanity checks. This is needed to read some Atari disks which have been made with the earlier ROMs, and which would not be recognized otherwise.
MTOOLS_FAT_COMPATIBILITY 
If this is set to 1, mtools skips the fat size checks. Some disks have a bigger FAT than they really need to. These are rejected if this option is not set.
MTOOLS_LOWER_CASE 
If this is set to 1, mtools displays all-upper-case short filenames as lowercase. This has been done to allow a behavior which is consistent with older versions of mtools which didn't know about the case bits.
MTOOLS_NO_VFAT 
If this is set to 1, mtools won't generate VFAT entries for filenames which are mixed-case, but otherwise legal dos filenames. This is useful when working with DOS versions which can't grok VFAT long names, such as FreeDOS.
MTOOLS_DOTTED_DIR 
In a wide directory, prints the short name with a dot instead of spaces separating the basename and the extension.
MTOOLS_NAME_NUMERIC_TAIL 
If this is set to one (default), generate numeric tails for all long names (~1). If set to zero, only generate numeric tails if otherwise a clash would have happened.
MTOOLS_TWENTY_FOUR_HOUR_CLOCK 
If 1, uses the European notation for times (twenty four hour clock), else uses the UK/US notation (am/pm)

Example: Inserting the following line into your configuration file instructs mtools to skip the sanity checks:
 

  MTOOLS_SKIP_CHECK=1


 

Global variables may also be set via the environment:
 

  export MTOOLS_SKIP_CHECK=1


 

Global string variables may be set to any value:

MTOOLS_DATE_STRING 
The format used for printing dates of files. By default, is dd-mm-yyyy.

 

Per drive flags and variables

 

  General information

Per drive flags and values may be described in a drive section. A drive section starts with drive "driveletter" :

Then follow variable-value pairs and flags.

This is a sample drive description:
 

  drive a:
    file="/dev/fd0" use_xdf=1


 

 

  Location information

For each drive, you need to describe where its data is physically stored (image file, physical device, partition, offset).

file 
The name of the file or device holding the disk image. This is mandatory. The file name should be enclosed in quotes.
partition 
Tells mtools to treat the drive as a partitioned device, and to use the given partition. Only primary partitions are accessible using this method, and they are numbered from 1 to 4. For logical partitions, use the more general offset variable. The partition variable is intended for removable media such as Syquest disks, ZIP drives, and magneto-optical disks. Although traditional DOS sees Syquest disks and magneto-optical disks as ∞giant floppy disksIntegral which are unpartitioned, OS/2 and Windows NT treat them like hard disks, i.e. partitioned devices. The partition flag is also useful DOSEMU hdimages. It is not recommended for hard disks for which direct access to partitions is available through mounting.
offset 
Describes where in the file the MS-DOS file system starts. This is useful for logical partitions in DOSEMU hdimages, and for ATARI ram disks. By default, this is zero, meaning that the file system starts right at the beginning of the device or file.

 

  Disk Geometry Configuration

Geometry information describes the physical characteristics about the disk. Its has three purposes:

formatting 
The geometry information is written into the boot sector of the newly made disk. However, you may also describe the geometry information on the command line. See section mformat, for details.
filtering 
On some Unixes there are device nodes which only support one physical geometry. For instance, you might need a different node to access a disk as high density or as low density. The geometry is compared to the actual geometry stored on the boot sector to make sure that this device node is able to correctly read the disk. If the geometry doesn't match, this drive entry fails, and the next drive entry bearing the same drive letter is tried. See section multiple descriptions, for more details on supplying several descriptions for one drive letter.
If no geometry information is supplied in the configuration file, all disks are accepted. On Linux (and on SPARC) there exist device nodes with configurable geometry (∞/dev/fd0Integral, ∞/dev/fd1Integral etc), and thus filtering is not needed (and ignored) for disk drives. (Mtools still does do filtering on plain files (disk images) in Linux: this is mainly intended for test purposes, as I don't have access to a Unix which would actually need filtering).
If you do not need filtering, but want still a default geometry for mformatting, you may switch off filtering using the mformat_only flag.
If you want filtering, you should supply the filter flag. If you supply a geometry, you must supply one of both flags.
initial geometry 
On devices that support it (usually floppy devices), the geometry information is also used to set the initial geometry. This initial geometry is applied while reading the boot sector, which contains the real geometry. If no geometry information is supplied in the configuration file, or if the mformat_only flag is supplied, no initial configuration is done.
On Linux, initial geometry is not really needed, as the configurable devices are able to auto-detect the disk type accurately enough (for most common formats) to read the boot sector.

Wrong geometry information may lead to very bizarre errors. That's why I strongly recommend that you add the mformat_only flag to your drive description, unless you really need filtering or initial geometry.

The following geometry related variables are available:

cylinders 

tracks
The number of cylinders. (cylinders is the preferred form, tracks is considered obsolete)
heads 
The number of heads (sides).
sectors 
The number of sectors per track.

Example: the following drive section describes a 1.44M drive:


 

  drive a:
      file="/dev/fd0H1440"
      fat_bits=12
      cylinders=80 heads=2 sectors=18
      mformat_only


 

The following shorthand geometry descriptions are available:

1.44m 
high density 3 1/2 disk. Equivalent to: fat_bits=12 cylinders=80 heads=2 sectors=18
1.2m 
high density 5 1/4 disk. Equivalent to: fat_bits=12 cylinders=80 heads=2 sectors=15
720k 
double density 3 1/2 disk. Equivalent to: fat_bits=12 cylinders=80 heads=2 sectors=9
360k 
double density 5 1/4 disk. Equivalent to: fat_bits=12 cylinders=40 heads=2 sectors=9

The shorthand format descriptions may be amended. For example, 360k sectors=8 describes a 320k disk and is equivalent to: fat_bits=12 cylinders=40 heads=2 sectors=8

 

  Open Flags

Moreover, the following flags are available:

sync 
All i/o operations are done synchronously
nodelay 
The device or file is opened with the O_NDELAY flag. This is needed on some non-Linux architectures.
exclusive 
The device or file is opened with the O_EXCL flag. On Linux, this ensures exclusive access to the floppy drive. On most other architectures, and for plain files it has no effect at all.

 

  General Purpose Drive Variables

The following general purpose drive variables are available. Depending to their type, these variables can be set to a string (precmd) or an integer (all others)

fat_bits 
The number of FAT bits. This may be 12 or 16. This is very rarely needed, as it can almost always be deduced from information in the boot sector. On the contrary, describing the number of fat bits may actually be harmful if you get it wrong. You should only use it if mtools gets the auto-detected number of fat bits wrong, or if you want to mformat a disk with a weird number of fat bits.
codepage 
Describes the DOS code page used for short filenames. This is a number between 1 and 999. By default, code page 850 is used. The reason for this is because this code page contains most of the characters that are also available in ISO-Latin-1. You may also specify a global code page for all drives by using the global default_codepage parameter (outside of any drive description). This parameters exists starting at version 4.0.0
precmd 
On some variants of Solaris, it is necessary to call 'volcheck -v' before opening a floppy device, in order for the system to notice that there is indeed a disk in the drive. precmd="volcheck -v" in the drive clause establishes the desired behavior.
blocksize 
This parameter represents a default block size to be always used on this device. All I/O is done with multiples of this block size, independently of the sector size registered in the file system's boot sector. This is useful for character devices whose sector size is not 512, such as for example CD-ROM drives on Solaris.

Only the file variable is mandatory. The other parameters may be left out. In that case a default value or an auto-detected value is used.

 

  General Purpose Drive Flags

A flag can either be set to 1 (enabled) or 0 (disabled). If the value is omitted, it is enabled. For example, scsi is equivalent to scsi=1

nolock 
Instruct mtools to not use locking on this drive. This is needed on systems with buggy locking semantics. However, enabling this makes operation less safe in cases where several users may access the same drive at the same time.
scsi 
When set to 1, this option tells mtools to use raw SCSI I/O instead of the standard read/write calls to access the device. Currently, this is supported on HP-UX, Solaris and SunOS. This is needed because on some architectures, such as SunOS or Solaris, PC media can't be accessed using the read and write system calls, because the OS expects them to contain a Sun specific "disk label".
As raw SCSI access always uses the whole device, you need to specify the "partition" flag in addition
On some architectures, such as Solaris, mtools needs root privileges to be able to use the scsi option. Thus mtools should be installed setuid root on Solaris if you want to access Zip/Jaz drives. Thus, if the scsi flag is given, privileged is automatically implied, unless explicitly disabled by privileged=0
Mtools uses its root privileges to open the device, and to issue the actual SCSI I/O calls. Moreover, root privileges are only used for drives described in a system-wide configuration file such as ∞/etc/mtools.confIntegral, and not for those described in ∞~/.mtoolsrcIntegral or ∞$MTOOLSRCIntegral.
privileged 
When set to 1, this instructs mtools to use its setuid and setgid privileges for opening the given drive. This option is only valid for drives described in the system-wide configuration files (such as ∞/etc/mtools.confIntegral, not ∞~/.mtoolsrcIntegral or ∞$MTOOLSRCIntegral). Obviously, this option is also a no op if mtools is not installed setuid or setgid. This option is implied by 'scsi=1', but again only for drives defined in system-wide configuration files. Privileged may also be set explicitly to 0, in order to tell mtools not to use its privileges for a given drive even if scsi=1 is set.
Mtools only needs to be installed setuid if you use the privileged or scsi drive variables. If you do not use these options, mtools works perfectly well even when not installed setuid root.
vold 
Instructs mtools to interpret the device name as a vold identifier rather than as a filename. The vold identifier is translated into a real filename using the media_findname() and media_oldaliases() functions of the volmgt library. This flag is only available if you configured mtools with the --enable-new-vold option before compilation.
swap 
Consider the media as a word-swapped Atari disk.
use_xdf 
If this is set to a non-zero value, mtools also tries to access this disk as an XDF disk. XDF is a high capacity format used by OS/2. This is off by default. See section XDF, for more details.
mformat_only 
Tells mtools to use the geometry for this drive only for mformatting and not for filtering.
filter 
Tells mtools to use the geometry for this drive both for mformatting and filtering.
remote 
Tells mtools to connect to floppyd (see section floppyd).

 

  Supplying multiple descriptions for a drive

It is possible to supply multiple descriptions for a drive. In that case, the descriptions are tried in order until one is found that fits. Descriptions may fail for several reasons:

1. 
because the geometry is not appropriate,
2. 
because there is no disk in the drive,
3. 
or because of other problems.

Multiple definitions are useful when using physical devices which are only able to support one single disk geometry. Example:
 

  drive a: file="/dev/fd0H1440" 1.44m
  drive a: file="/dev/fd0H720" 720k


 

This instructs mtools to use /dev/fd0H1440 for 1.44m (high density) disks and /dev/fd0H720 for 720k (double density) disks. On Linux, this feature is not really needed, as the /dev/fd0 device is able to handle any geometry.

You may also use multiple drive descriptions to access both of your physical drives through one drive letter:


 

  drive z: file="/dev/fd0"
  drive z: file="/dev/fd1"


 

With this description, mdir z: accesses your first physical drive if it contains a disk. If the first drive doesn't contain a disk, mtools checks the second drive.

When using multiple configuration files, drive descriptions in the files parsed last override descriptions for the same drive in earlier files. In order to avoid this, use the drive+ or +drive keywords instead of drive. The first adds a description to the end of the list (i.e. it will be tried last), and the first adds it to the start of the list.

 

Location of configuration files and parsing order

The configuration files are parsed in the following order:

1. 
compiled-in defaults
2. 
∞/etc/mtools.confIntegral
3. 
∞~/.mtoolsrcIntegral.
4. 
∞$MTOOLSRCIntegral (file pointed by the MTOOLSRC environmental variable)

Options described in the later files override those described in the earlier files. Drives defined in earlier files persist if they are not overridden in the later files. For instance, drives A and B may be defined in ∞/etc/mtools.confIntegral and drives C and D may be defined in ∞~/.mtoolsrcIntegral However, if ∞~/.mtoolsrcIntegral also defines drive A, this new description would override the description of drive A in ∞/etc/mtools.confIntegral instead of adding to it. If you want to add a new description to a drive already described in an earlier file, you need to use either the +drive or drive+ keyword.

 

Backwards compatibility with old configuration file syntax

The syntax described herein is new for version mtools-3.0. The old line-oriented syntax is still supported. Each line beginning with a single letter is considered to be a drive description using the old syntax. Old style and new style drive sections may be mixed within the same configuration file, in order to make upgrading easier. Support for the old syntax will be phased out eventually, and in order to discourage its use, I purposefully omit its description here.

 

See also

mtools


 

Index

Name
Description
Location of the configuration files
  General configuration file syntax
Default values
Global variables
Per drive flags and variables
  General information
  Location information
  Disk Geometry Configuration
  Open Flags
  General Purpose Drive Variables
  General Purpose Drive Flags
  Supplying multiple descriptions for a drive
Location of configuration files and parsing order
Backwards compatibility with old configuration file syntax
See also

This document was created by man2html, using the manual pages.
Time: 04:45:55 GMT, September 16, 2022

댓글 쓰기

0 댓글