Next: miscellaneous flags, Previous: open flags, Up: per drive variables [Contents][Index]
The following general purpose drive variables are available. Depending to their type, these variables can be set to a string (precmd, postcmd) 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
data_map
Remaps data from image file. This is useful for image files which
might need additional zero-filled sectors to be inserted. Such is the
case for instance for IBM 3174 floppy images. These images represent
floppy disks with fewer sectors on their first cylinder. These missing
sectors are not stored in the image, but are still counted in the
filesystem layout. The data_map allows to fake these missing sectors
for the upper layers of mtools. A data_map is a comma-separated
sequence of source type and size. Source type may be zero
for
zero-filled sectors created by map, skip
for data in raw image
to be ignored (skipped), and nothing for data to be used as is
(copied) from the raw image. Datamap is automatically complemented by
an implicit last element of data to be used as is from current offset
to end of file. Each size is a number followed by a unit: s
for
a 512 byte sector, K
for Kbytes, M
for megabytes,
G
for gigabytes, and nothing for single bytes.
Example:
data_map=1s,zero31s,28s,skip1s
would be a map for use with IBM
3174 floppy images. First sector (1s
, boot sector) is used as
is. Then follow 31 fake zero-filled sectors (zero31s
), then the
next 28 sectors from image (28s
) are used as is (they contain
FAT and root directory), then one sector from image is skipped
(skip1s
), and finally the rest of image is used as is
(implicit)
precmd
Executes the given command before opening the device.
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.
postcmd
Executes the given command after closing the device. May be useful if mtools shares the image file with some other application, in order to release the image file to that application.
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.
Next: miscellaneous flags, Previous: open flags, Up: per drive variables [Contents][Index]