home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / CMDS / mtools_3.6.docs.lzh / MTOOLS_3.6 / DOCS / mtools.1 < prev    next >
Text File  |  1997-11-12  |  75KB  |  2,210 lines

  1. '\" t
  2. .TH mtools.1 3 14mar1997 MTOOLS MTOOLS
  3. '\" t
  4. .de TQ
  5. .br
  6. .ns
  7. .TP \\$1
  8. ..
  9.  
  10. .tr \(is'
  11. .tr \(if`
  12. .tr \(pd"
  13.  
  14. .ds St Mtools
  15. .oh '\\*(St''%'
  16. .eh '%''\\*(St'
  17. .PP
  18. .SH Name
  19. mtools - utilities to access DOS disks in Unix.
  20. .PP
  21. .SH Introduction
  22. Mtools is a public domain collection of tools to allow Unix systems to
  23. manipulate MS-DOS files: read, write, and move around files on an MS-DOS
  24. filesystem (typically a floppy disk).  Where reasonable, each program
  25. attempts to emulate the MS-DOS equivalent command. However, unnecessary
  26. restrictions and oddities of DOS are not emulated. For instance, it is
  27. possible to move subdirectories from one subdirectory to another.
  28. .PP
  29. .SH Common\ features\ of\ all\ mtools\ commands
  30. .PP
  31. .SS Options\ and\ filenames
  32. .iX "c Filenames"
  33. .iX "c Options"
  34. MS-DOS filenames are composed of a drive letter followed by a colon, a
  35. subdirectory, and a filename. Only the filename part is mandatory, the
  36. drive letter and the subdirectory are optional. Filenames without a
  37. drive letter refer to Unix files. Subdirectory names can use either the
  38. \&'\fR\&\f(CW/\fR' or '\fR\&\f(CW\e\fR' separator.  The use of the '\fR\&\f(CW\e\fR' separator
  39. or wildcards requires the names to be enclosed in quotes to protect them
  40. from the shell. However, wildcards in Unix filenames should not be
  41. enclosed in quotes, because here we \fBwant\fR the shell to expand
  42. them.
  43. .PP
  44. The regular expression "pattern matching" routines follow the Unix-style
  45. rules.  For example, `\fR\&\f(CW*\fR' matches all MS-DOS files in lieu of
  46. `\fR\&\f(CW*.*\fR'.  The archive, hidden, read-only and system attribute bits
  47. are ignored during pattern matching.
  48. .PP
  49. All options use the \fR\&\f(CW-\fR (minus) as their first character, not
  50. \&\fR\&\f(CW/\fR as you'd expect in MS-DOS.
  51. .PP
  52. Most mtools commands allow multiple filename parameters, which
  53. doesn't follow MS-DOS conventions, but which is more user-friendly.
  54. .PP
  55. Most mtools commands allow options that instruct them how to handle file
  56. name clashes. See section name clashes, for more details on these. All
  57. commands accept the \fR\&\f(CW-V\fR flags which prints the version, and most
  58. accept the \fR\&\f(CW-v\fR flag, which switches on verbose mode. In verbose
  59. mode, these commands print out the name of the MS-DOS files upon which
  60. they act, unless stated otherwise. See section Commands, for a description of
  61. the options which are specific to each command.
  62. .PP
  63. .SS Drive\ letters
  64. .PP
  65. The meaning of the drive letters depends on the target architectures.
  66. However, on most target architectures, drive A is the first floppy
  67. drive, drive B is the second floppy drive (if available), drive J is a
  68. Jaz drive (if available), and drive Z is a Zip drive (if available).  On
  69. those systems where the device name is derived from the SCSI id, the Jaz
  70. drive is assumed to be at Scsi target 4, and the Zip at Scsi target 5
  71. (factory default settings).  On Linux, both drives are assumed to be the
  72. second drive on the Scsi bus (/dev/sdb). The default settings can be
  73. changes using a configuration file (See section Configuration).
  74. .PP
  75. .SS Current\ working\ directory
  76. .iX "p mcd (introduction)"
  77. .iX "c Directory"
  78. .iX "c Working directory"
  79. .iX "c Current working directory"
  80. .iX "c Default directory"
  81. .PP
  82. The \fR\&\f(CWmcd\fR command (\(ifmcd\(is) is used to establish the device and
  83. the current working directory (relative to the MS-DOS filesystem),
  84. otherwise the default is assumed to be \fR\&\f(CWA:/\fR. However, unlike
  85. MS-DOS, there is only one working directory for all drives, and not one
  86. per drive.
  87. .PP
  88. .SS VFAT-style\ long\ file\ names
  89. .iX "c Long file name"
  90. .iX "c Windows 95-style file names"
  91. .iX "c VFAT-style file names"
  92. .iX "c Primary file name (long names)"
  93. .iX "c Secondary file name (long names)"
  94. .PP
  95. This version of mtools supports VFAT style long filenames. If a Unix
  96. filename is too long to fit in a short DOS name, it is stored as a
  97. VFAT long name, and a companion short name is generated. This short
  98. name is what you see when you examine the disk with a pre-7.0 version
  99. of DOS.
  100.  The following table shows some examples of short names:
  101. .PP
  102.  
  103. .nf
  104. .ft 3
  105. .in +0.3i
  106. Long name       MS-DOS name      Reason for the change
  107. ---------       ----------      ---------------------
  108. thisisatest     THISIS~1        filename too long
  109. alain.knaff     ALAIN~1.KNA     extension too long
  110. prn.txt         PRN~1.TXT       PRN is a device name
  111. \&\&.abc            ABC~1           null filename
  112. hot+cold        HOT_CO~1        illegal character
  113. .fi
  114. .in -0.3i
  115. .ft R
  116. .lp
  117.  
  118. \&\fR
  119. .PP
  120.  As you see, the following transformations happen to derive a short
  121. name:
  122. .TP
  123. * \ \ 
  124. Illegal characters are replaced by underscores. The illegal characters
  125. are \fR\&\f(CW;+=[]',\e"*\e\e<>/?:|\fR.
  126. .TP
  127. * \ \ 
  128. Extra dots, which cannot be interpreted as a main name/extension
  129. separator are removed
  130. .TP
  131. * \ \ 
  132. A \fR\&\f(CW~\fR\fIn\fR number is generated,
  133. .TP
  134. * \ \ 
  135. The name is shortened so as to fit in the 8+3 limitation
  136. .PP
  137.  The initial Unix-style file name (whether long or short) is also called
  138. the \fIprimary\fR name, and the derived short name is also called the
  139. \&\fIsecondary\fR name.
  140. .PP
  141.  Example:
  142.  
  143. .nf
  144. .ft 3
  145. .in +0.3i
  146.  mcopy /etc/motd a:Reallylongname
  147. .fi
  148. .in -0.3i
  149. .ft R
  150. .lp
  151.  
  152. \&\fR Mtools creates a VFAT entry for Reallylongname, and uses REALLYLO as
  153. a short name. Reallylongname is the primary name, and REALLYLO is the
  154. secondary name.
  155.  
  156. .nf
  157. .ft 3
  158. .in +0.3i
  159.  mcopy /etc/motd a:motd
  160. .fi
  161. .in -0.3i
  162. .ft R
  163. .lp
  164.  
  165. \&\fR Motd fits into the DOS filename limits. Mtools doesn't need to
  166. derivate another name. Motd is the primary name, and there is no
  167. secondary name.
  168. .PP
  169.  In a nutshell: The primary name is the long name, if one exists, or
  170. the short name if there is no long name.
  171. .PP
  172.  Although VFAT is much more flexible than FAT, there are still names
  173. that are not acceptable, even in VFAT. There are still some illegal
  174. characters left (\fR\&\f(CW\e"*\e\e<>/?:|\fR), and device names are still
  175. reserved.
  176. .PP
  177.  
  178. .nf
  179. .ft 3
  180. .in +0.3i
  181. Unix name       Long name      Reason for the change
  182. ---------       ----------      ---------------------
  183. prn             prn-1           PRN is a device name
  184. ab:c            ab_c-1          illegal character
  185. .fi
  186. .in -0.3i
  187. .ft R
  188. .lp
  189.  
  190. \&\fR
  191. .PP
  192.  As you see, the following transformations happen if a long name is
  193. illegal:
  194. .TP
  195. * \ \ 
  196. Illegal characters are replaces by underscores,
  197. .TP
  198. * \ \ 
  199. A \fR\&\f(CW-\fR\fIn\fR number is generated,
  200. .PP
  201. .SS Name\ clashes
  202. .iX "c Name clashes"
  203. .iX "c Duplicate file names"
  204. .iX "c Overwriting files"
  205. .iX "c Primary file name (name clashes)"
  206. .iX "c Secondary file name (name clashes)"
  207. .PP
  208. When writing a file to disk, its long name (primary name) or short name
  209. may collide with an already existing file or directory. This may happen
  210. for all commands which create new directory entries, such as
  211. \&\fR\&\f(CWmcopy\fR, \fR\&\f(CWmmd\fR, \fR\&\f(CWmren\fR, \fR\&\f(CWmmove\fR,
  212. \&\fR\&\f(CWmwrite\fR and \fR\&\f(CWmread\fR. When a name clash happens, mtools
  213. asks you what it should do. It offers several choices:
  214. .TP
  215. \&\fR\&\f(CWoverwrite\fR\ 
  216. Overwrites the existing file. It is not possible to overwrite a
  217. directory with a file.
  218. .TP
  219. \&\fR\&\f(CWrename\fR\ 
  220. Renames the newly created file. Mtools prompts for the new filename
  221. .TP
  222. \&\fR\&\f(CWautorename\fR\ 
  223. Renames the newly created file. Mtools chooses a name by itself, without
  224. prompting
  225. .TP
  226. \&\fR\&\f(CWskip\fR\ 
  227. Gives up on this file, and moves on to the next (if any)
  228. .PP
  229. To chose one of these actions, type its first letter at the prompt. If
  230. you use a lower case letter, the action only applies for this file only,
  231. if you use an upper case letter, the action applies to all files, and
  232. you won't be prompted again.
  233. .PP
  234. You may also chose actions (for all files) on the command line, when
  235. invoking mtools:
  236. .TP
  237. \&\fR\&\f(CW-o\fR\ 
  238. Overwrites primary names by default.
  239. .TP
  240. \&\fR\&\f(CW-O\fR\ 
  241. Overwrites secondary names by default.
  242. .TP
  243. \&\fR\&\f(CW-r\fR\ 
  244. Renames primary name by default.
  245. .TP
  246. \&\fR\&\f(CW-R\fR\ 
  247. Renames secondary name by default.
  248. .TP
  249. \&\fR\&\f(CW-a\fR\ 
  250. Autorenames primary name by default.
  251. .TP
  252. \&\fR\&\f(CW-A\fR\ 
  253. Autorenames secondary name by default.
  254. .TP
  255. \&\fR\&\f(CW-s\fR\ 
  256. Skip primary name by default.
  257. .TP
  258. \&\fR\&\f(CW-S\fR\ 
  259. Skip secondary name by default.
  260. .TP
  261. \&\fR\&\f(CW-m\fR\ 
  262. Ask user what to do with primary name.
  263. .TP
  264. \&\fR\&\f(CW-M\fR\ 
  265. Ask user what to do with secondary name.
  266. .PP
  267. By default, the user is prompted if the primary name clashes, and the
  268. secondary name is autorenamed.
  269. .PP
  270. If a name clash occurs in a Unix directory, mtools only asks whether
  271. to overwrite the file, or to skip it.
  272. .PP
  273. .SS Case\ sensitivity\ of\ the\ VFAT\ filesystem
  274. .iX "c Case sensitivity"
  275. .PP
  276. The VFAT filesystem is able to remember the case of the
  277. filenames. However, filenames which differ only in case are not allowed
  278. to coexist in the same directory. For example if you store a file called
  279. LongFileName on a VFAT filesystem, mdir shows this file as LongFileName,
  280. and not as Longfilename. However, if you then try to add LongFilename to
  281. the same directory, it is refused, because case is ignored for clash
  282. checks.
  283. .PP
  284. The VFAT filesystem allows to store the case of a filename in the
  285. attribute byte, if all letters of the filename are the same case, and if
  286. all letters of the extension are the same case too. Mtools uses this
  287. information when displaying the files, and also to generate the Unix
  288. filename when mcopying to a Unix directory. This may have unexpected
  289. results when applied to files written using an pre-7.0 version of DOS:
  290. Indeed, the old style filenames map to all upper case. This is different
  291. from the behavior of the old version of mtools which used to generate
  292. lower case Unix filenames.
  293. .PP
  294. .SS high\ capacity\ formats
  295. .iX "c Special formats"
  296. .iX "c High capacity formats"
  297. .iX "c Odd formats"
  298. .iX "c Weird formats"
  299. .iX "c Formats, high capacity"
  300. .iX "c Linux enhancements (High Capacity Formats)"
  301. .PP
  302. Mtools supports a number of formats which allow to store more data on
  303. disk as usual. Due to different operating system abilities, these
  304. formats are not supported on all OS'es. Mtools recognizes these formats
  305. transparently where supported.
  306. .PP
  307. In order to format these disks, you need to use an operating system
  308. specific tool. For Linux, suitable floppy tools can be found in the
  309. \&\fR\&\f(CWfdutils\fR package at the following locations~:
  310.  
  311. .nf
  312. .ft 3
  313. .in +0.3i
  314. \&\fR\&\f(CWftp://linux.wauug.org/pub/knaff/fdutils/.
  315. \&\fR\&\f(CWftp://tsx-11.mit.edu/pub/linux/sources/sbin/fdutils-*
  316. \&\fR\&\f(CWftp://sunsite.unc.edu/pub/Linux/system/Misc/fdutils-*
  317. .fi
  318. .in -0.3i
  319. .ft R
  320. .lp
  321.  
  322. \&\fR
  323. .PP
  324. See the manpages included in that package for further detail: Use
  325. \&\fR\&\f(CWsuperformat\fR to format all formats except XDF, and use
  326. \&\fR\&\f(CWxdfcopy\fR to format XDF.
  327. .PP
  328. .SS \ \ More\ sectors
  329. .iX "c fdformat"
  330. .iX "c vgacopy"
  331. .iX "c DMF disks"
  332. .iX "c Windows 95 (DMF disks)"
  333. .PP
  334. The oldest method of fitting more data on a disk is to use more sectors
  335. and more tracks. Although the standard format uses 80 tracks and 18
  336. sectors (on a 3 1/2 high density disk), it is possible to use up to 83
  337. tracks (on most drives) and up to 21 sectors. This method allows to
  338. store up to 1743K on a 3 1/2 HD disk. However, 21 sector disks are twice
  339. as slow as the standard 18 sector disks because the sectors are packed
  340. so close together that we need to interleave them. This problem doesn't
  341. exist for 20 sector formats.
  342. .PP
  343. These formats are supported by numerous DOS shareware utilities such as
  344. \&\fR\&\f(CWfdformat\fR and \fR\&\f(CWvgacopy\fR. In his infinite hybris, Bill Gate$
  345. believed that he invented this, and called it \fR\&\f(CW\(ifDMF disks\(is\fR, or
  346. \&\fR\&\f(CW\(ifWindows formatted disks\(is\fR. But in reality, it has already existed
  347. years before! Mtools supports these formats on Linux, on SunOs and on
  348. the DELL Unix PC.
  349. .PP
  350. .SS \ \ Bigger\ sectors
  351. .iX "c 2m"
  352. By using bigger sectors it is possible to go beyond the capacity which
  353. can be obtained by the standard 512-byte sectors. This is because of the
  354. sector header. The sector header has the same size, regardless of how
  355. many data bytes are in the sector. Thus, we save some space by using
  356. \&\fIfewer\fR, but bigger sectors. For example, 1 sector of 4K only takes
  357. up header space once, whereas 8 sectors of 512 bytes have also 8
  358. headers, for the same amount of useful data.
  359. .PP
  360. This method allows to store up to 1992K on a 3 1/2 HD disk.
  361. .PP
  362. Mtools supports these formats only on Linux.
  363. .PP
  364. .SS \ \ 2m
  365. .iX "c 2m"
  366. .PP
  367. The 2m format was originally invented by Ciriaco Garcia de Celis. It
  368. also uses bigger sectors than usual in order to fit more data on the
  369. disk.  However, it uses the standard format (18 sectors of 512 bytes
  370. each) on the first cylinder, in order to make these disks easyer to
  371. handle by DOS. Indeed this method allows to have a standard sized
  372. bootsector, which contains a description of how the rest of the disk
  373. should be read.
  374. .PP
  375. However, the drawback of this is that the first cylinder can hold less
  376. data than the others. Unfortunately, DOS can only handle disks where
  377. each track contains the same amount of data. Thus 2m hides the fact that
  378. the first track contains less data by using a \fIshadow
  379. FAT\fR. (Usually, DOS stores the FAT in two identical copies, for
  380. additional safety.  XDF stores only one copy, and it tells DOS that it
  381. stores two. Thus the same that would be taken up by the second FAT copy
  382. is saved.) This also means that your should \fBnever use a 2m disk
  383. to store anything else than a DOS fs\fR.
  384. .PP
  385. Mtools supports these format only on Linux.
  386. .PP
  387. .SS \ \ XDF
  388. .iX "c XDF disks"
  389. .iX "c OS/2 (XDF disks)"
  390. .PP
  391. XDF is a high capacity format used by OS/2. It can hold 1840 K per
  392. disk. That's lower than the best 2m formats, but its main advantage is
  393. that it is fast: 600 milliseconds per track. That's faster than the 21
  394. sector format, and almost as fast as the standard 18 sector format. In
  395. order to access these disks, make sure mtools has been compiled with XDF
  396. support, and set the \fR\&\f(CWuse_xdf\fR variable for the drive in the
  397. configuration file. See section Compiling mtools and \(ifmisc variables\(is,
  398. for details on how to do this. Fast XDF access is only available for
  399. Linux kernels which are more recent than 1.1.34.
  400. .PP
  401. Mtools supports this format only on Linux.
  402. .PP
  403. \&\fBCaution / Attention distributors\fR: If mtools is compiled on a
  404. Linux kernel more recent than 1.3.34, it won't run on an older
  405. kernel. However, if it has been compiled on an older kernel, it still
  406. runs on a newer kernel, except that XDF access is slower. It is
  407. recommended that distribution authors only include mtools binaries
  408. compiled on kernels older than 1.3.34 until 2.0 comes out. When 2.0 will
  409. be out, mtools binaries compiled on newer kernels may (and should) be
  410. distributed. Mtools binaries compiled on kernels older than 1.3.34 won't
  411. run on any 2.1 kernel or later.
  412. .PP
  413. .SS Exit\ codes
  414. All the Mtools commands return 0 on success, 1 on utter failure, or 2
  415. on partial failure.  All the Mtools commands perform a few sanity
  416. checks before going ahead, to make sure that the disk is indeed an
  417. MS-DOS disk (as opposed to, say an ext2 or minix disk). These checks
  418. may reject partially corrupted disks, which might otherwise still be
  419. readable. To avoid these checks, set the MTOOLS_SKIP_CHECK
  420. environmental variable or the corresponding configuration file variable
  421. (see section  global variables)
  422. .SS Bugs
  423. An unfortunate side effect of not guessing the proper device (when
  424. multiple disk capacities are supported) is an occasional error message
  425. from the device driver.  These can be safely ignored.  
  426. .PP
  427. The fat checking code chokes on 1.72 Mb disks mformatted with pre-2.0.7
  428. mtools. Set the environmental variable MTOOLS_FAT_COMPATIBILITY (or the
  429. corresponding configuration file variable, \(ifglobal variables\(is) to
  430. bypass the fat checking.
  431. .PP
  432. .SH How\ to\ configure\ mtools\ for\ your\ environment
  433. .SS Description
  434. .iX "c Configuration files"
  435. .iX "v MTOOLSRC"
  436. .PP
  437.  This sections explains the syntax of the configurations files for
  438. mtools. The configuration files are called
  439. \&\fR\&\f(CW\(if/usr/local/etc/mtools.conf\(is\fR and \fR\&\f(CW\(if~/.mtoolsrc\(is\fR. If the
  440. environmental variable \fR\&\f(CWMTOOLSRC\fR is set, its contents is used as
  441. the filename for a third configuration file. These configuration files
  442. describe the following items:
  443. .TP
  444. * \ Global\ configuration\ flags\ and\ variables\ 
  445. .TP
  446. * \ Per\ drive\ flags\ and\ variables\ 
  447. .TP
  448. * \ Character\ translation\ tables\ 
  449. .PP
  450. .SS Location\ of\ the\ configuration\ files
  451. .PP
  452. .iX "c Configuration file name"
  453. .iX "c Name of configuration files"
  454. .iX "c Location of configuration files"
  455. .PP
  456. \&\fR\&\f(CW\(if/usr/local/etc/mtools.conf\(is\fR is the system-wide configuration file,
  457. and \fR\&\f(CW\(if~/.mtoolsrc\(is\fR is the user's private configuration file.
  458. .PP
  459. On some systems, the system-wide configuration file is called
  460. \&\fR\&\f(CW\(if/etc/defaults/mtools.conf\(is\fR instead.
  461. .PP
  462. .SS \ \ General\ configuration\ file\ syntax
  463. .iX "c Syntax of the configuration file"
  464. .iX "c Configuration file syntax"
  465. .PP
  466. The configuration files is made up of sections. Each section starts
  467. with a keyword identifying the section followed by a colon.
  468. Then follow variable assignments and flags. Variable assignments take
  469. the following form:
  470. .(l I
  471. name=value
  472. .)l
  473.  
  474. Flags are lone keywords without an equal sign and value following
  475. them.  A section either ends at the end of the file or where the next
  476. section begins.
  477. .PP
  478. Lines starting with a hash (\fR\&\f(CW#\fR) are comments. Newline characters
  479. are equivalent to whitespace (except where ending a comment). The
  480. configuration file is case insensitive, except for item enclosed in
  481. quotes (such as filenames).
  482. .PP
  483. .SS Default\ values
  484. .iX "c Default values"
  485. .iX "c Default configuration"
  486. .iX "c Configuration file"
  487. For most platforms, mtools contains reasonable compiled-in defaults for
  488. physical floppy drives.  Thus, you usually don't need to bother with the
  489. configuration file, if all you want to do with mtools is to access your
  490. floppy drives. On the other hand, the configuration file is needed if
  491. you also want to use mtools to access your hard disk partitions and
  492. dosemu image files.
  493. .PP
  494. .SS Global\ variables
  495. .iX "c Global configuration variables"
  496. .iX "c Drive independent configuration variables"
  497. .iX "c Environmental variables"
  498. .iX "v MTOOLS_SKIP_CHECK"
  499. .iX "v MTOOLS_FAT_COMPATIBILITY"
  500. .iX "v MTOOLS_LOWER_CASE"
  501. .iX "v MTOOLS_NO_VFAT"
  502. .iX "c FreeDos"
  503. .iX "c Caldera FreeDos"
  504. .PP
  505. Global variables may be set to 1 or to 0.
  506. .PP
  507. The following global flags are recognized:
  508. .TP
  509. \&\fR\&\f(CWMTOOLS_SKIP_CHECK\fR\ 
  510. If this is set to 1, mtools skips most of its sanity checks. This is
  511. needed to read some Atari disks which have been made with the earlier
  512. ROMs, and which would not be recognized otherwise.
  513. .TP
  514. \&\fR\&\f(CWMTOOLS_FAT_COMPATIBILITY\fR\ 
  515. If this is set to 1, mtools skips the fat size checks. Some disks have
  516. a bigger FAT than they really need to. These are rejected if this
  517. option is not set.
  518. .TP
  519. \&\fR\&\f(CWMTOOLS_LOWER_CASE\fR\ 
  520. If this is set to 1, mtools displays all-upper-case short filenames as
  521. lowercase. This has been done to allow a behavior which is consistent
  522. with older versions of mtools which didn't know about the case bits.
  523. .TP
  524. \&\fR\&\f(CWMTOOLS_NO_VFAT\fR\ 
  525. If this is set to 1, mtools won't generate VFAT entries for filenames
  526. which are mixed-case, but otherwise legal dos filenames.  This is useful
  527. when working with DOS versions which can't grok VFAT longnames, such as
  528. Caldera's FreeDos.
  529. .PP
  530. Example:
  531. Inserting the following line into your configuration file instructs
  532. mtools to skip the sanity checks:
  533.  
  534. .nf
  535. .ft 3
  536. .in +0.3i
  537.   MTOOLS_SKIP_CHECK=1
  538. .fi
  539. .in -0.3i
  540. .ft R
  541. .lp
  542.  
  543. \&\fR
  544. .PP
  545. Global variables may also be set via the environment:
  546.  
  547. .nf
  548. .ft 3
  549. .in +0.3i
  550.   export MTOOLS_SKIP_CHECK=1
  551. .fi
  552. .in -0.3i
  553. .ft R
  554. .lp
  555.  
  556. \&\fR
  557. .PP
  558. .SS Per\ drive\ flags\ and\ variables
  559. .iX "c Drive description"
  560. .iX "c Drive configuration"
  561. .PP
  562. .SS \ \ General\ information
  563. .iX "c Drive description, example"
  564. .iX "c Drive configuration, example"
  565. .iX "v drive"
  566. .PP
  567. Per drive flags and values may be described in a drive section. A
  568. drive section starts with
  569. \&\fR\&\f(CWdrive\fR "\fIdriveletter\fR" :
  570. .PP
  571. Then follow variable-value pairs and flags.
  572. .PP
  573. This is a sample drive description:
  574.  
  575. .nf
  576. .ft 3
  577. .in +0.3i
  578.   drive a:
  579.     file="/dev/fd0" use_xdf=1
  580. .fi
  581. .in -0.3i
  582. .ft R
  583. .lp
  584.  
  585. \&\fR
  586. .PP
  587. .SS \ \ Disk\ Geometry\ Configuration
  588. .iX "c Disk Geometry"
  589. .iX "c Configuration of disk geometry"
  590. .iX "c Description of disk geometry"
  591. .iX "c Format of disk"
  592. .iX "c High density disk"
  593. .iX "c Low density disk"
  594. .iX "p mformat (geometry used for)"
  595. .PP
  596. Geometry information describes the physical characteristics about the
  597. disk. Its has three purposes:
  598. .TP
  599. formatting\ 
  600. The geometry information is written into the boot sector of the newly
  601. made disk. However, you may also describe the geometry information on
  602. the command line. See section mformat for details.
  603. .TP
  604. filtering\ 
  605. On some Unices there are device nodes which only support one physical
  606. geometry. For instance, you might need a different node to access a disk
  607. as high density or as low density. The geometry is compared to the
  608. actual geometry stored on the boot sector to make sure that this device
  609. node is able to correctly read the disk. If the geometry doesn't match,
  610. this drive entry fails, and the next drive entry bearing the same drive
  611. letter is tried. See section multiple descriptions for more details on
  612. supplying several descriptions for one drive letter.
  613. .IP
  614. If no geometry information is supplied in the configuration file, all
  615. disks are accepted. On Linux (and on Sparc) there exist device nodes
  616. with configurable geometry (\fR\&\f(CW\(if/dev/fd0\(is\fR, \fR\&\f(CW\(if/dev/fd1\(is\fR etc),
  617. and thus filtering is not needed (and ignored) for disk drives.  (Mtools
  618. still does do filtering on plain files (disk images) in Linux: this is
  619. mainly intended for test purposes, as I don't have access to a Unix
  620. which would actually need filtering).
  621. .TP
  622. initial\ geometry\ 
  623. The geometry information (if available) is also used to set the
  624. initial geometry on configurable device nodes. This initial geometry
  625. is used to read the boot sector, which contains the real geometry.  If
  626. no geometry information is supplied in the configuration file, no
  627. initial configuration is done. On Linux, this is not really needed
  628. either, as the configurable devices are able to auto-detect the disk
  629. type accurately enough (for most common formats) to read the boot
  630. sector.
  631. .PP
  632. Wrong geometry information may lead to very bizarre errors. That's why I
  633. strongly recommend that you don't use geometry configuration unless you
  634. actually need it.
  635. .PP
  636. The following geometry related variables are available:
  637. .TP
  638. \&\fR\&\f(CWcylinders\fR\ 
  639. .TQ
  640. \&\fR\&\f(CWcylinders\fR
  641. .iX "v cylinders"
  642. .iX "v tracks"
  643. The number of cylinders. (\fR\&\f(CWcylinders\fR is the preferred form,
  644. \&\fR\&\f(CWtracks\fR is considered obsolete)
  645. .TP
  646. \&\fR\&\f(CWheads\fR\ 
  647. .iX "v heads"
  648. The number of heads (sides).
  649. .TP
  650. \&\fR\&\f(CWsectors\fR\ 
  651. .iX "v sectors"
  652. The number of sectors per track.
  653. .PP
  654. Example: the following drive section describes a 1.44M drive:
  655. .PP
  656.  
  657. .nf
  658. .ft 3
  659. .in +0.3i
  660.   drive a:
  661.       file="/dev/fd0H1440"
  662.       fat_bits=12
  663.       cylinders=80 heads=2 sectors=18
  664. .fi
  665. .in -0.3i
  666. .ft R
  667. .lp
  668.  
  669. \&\fR
  670. .PP
  671. The following shorthand geometry descriptions are available:
  672. .TP
  673. \&\fR\&\f(CW1.44m\fR\ 
  674. high density 3 1/2 disk. Equivalent to:
  675. \&\fR\&\f(CWfat_bits=12 cylinders=80 heads=2 sectors=18\fR
  676. .TP
  677. \&\fR\&\f(CW1.2m\fR\ 
  678. high density 5 1/4 disk. Equivalent to:
  679. \&\fR\&\f(CWfat_bits=12 cylinders=80 heads=2 sectors=15\fR
  680. .TP
  681. \&\fR\&\f(CW720k\fR\ 
  682. double density 3 1/2 disk. Equivalent to:
  683. \&\fR\&\f(CWfat_bits=12 cylinders=80 heads=2 sectors=9\fR
  684. .TP
  685. \&\fR\&\f(CW360k\fR\ 
  686. double density 5 1/4 disk. Equivalent to:
  687. \&\fR\&\f(CWfat_bits=12 cylinders=40 heads=2 sectors=9\fR
  688. .PP
  689. The shorthand format descriptions may be amended. For example,
  690. \&\fR\&\f(CW360k sectors=8\fR
  691. describes a 320k disk and is equivalent to:
  692. \&\fR\&\f(CWfat_bits=12 cylinders=40 heads=2 sectors=8\fR
  693. .PP
  694. .SS \ \ Open\ Flags
  695. .iX "v sync"
  696. .iX "v nodelay"
  697. .iX "v exclusive"
  698. .iX "c open flags"
  699. .iX "c synchronous writing"
  700. .iX "c exclusive access to a drive"
  701. .PP
  702. Moreover, the following flags are available:
  703. .TP
  704. \&\fR\&\f(CWsync\fR\ 
  705. All i/o operations are done synchronously
  706. .TP
  707. \&\fR\&\f(CWnodelay\fR\ 
  708. The device or file is opened with the O_NDELAY flag. This is needed on
  709. some non-Linux architectures.
  710. .TP
  711. \&\fR\&\f(CWexclusive\fR\ 
  712. The device or file is opened with the O_EXCL flag. On Linux, this
  713. ensures exclusive access to the floppy drive. On most other
  714. architectures, and for plain files it has no effect at all.
  715. .PP
  716. .SS General\ Purpose\ Drive\ Variables
  717. .PP
  718. .iX "c Hdimage"
  719. .PP
  720. The following general purpose drive variables are available:
  721. .TP
  722. \&\fR\&\f(CWfile\fR\ 
  723. .iX "c Image file"
  724. .iX "c Name of device node"
  725. .iX "c File name of device node"
  726. .iX "v file"
  727. The name of the file or device holding the disk image. This is
  728. mandatory. The file name should be enclosed in quotes.
  729. .TP
  730. \&\fR\&\f(CWuse_xdf\fR\ 
  731. .iX "c XDF disks (how to configure)"
  732. .iX "v use_xdf"
  733. If this is set to a non-zero value, mtools also tries to access this
  734. disk as an XDF disk. XDF is a high capacity format used by OS/2. This
  735. is off by default. See section XDF for more details.
  736. .TP
  737. \&\fR\&\f(CWpartition\fR\ 
  738. .iX "c Dosemu hard disk image"
  739. .iX "c Zip disks (partitions)"
  740. .iX "c Jaz disks (partitions)"
  741. .iX "c Syquest disks"
  742. .iX "c Magneto-optical disks"
  743. .iX "c OS/2 (layout of removable media)"
  744. .iX "c Windows NT (layout of removable media)"
  745. .iX "c Removable media"
  746. .iX "c Partitioned image file"
  747. Tells mtools to treat the drive as a partitioned device, and to use the
  748. given partition. Only primary partitions are accessible using this
  749. method, and they are numbered from 1 to 4. For logical partitions, use
  750. the more general \fR\&\f(CWoffset\fR variable. The \fR\&\f(CWpartition\fR variable
  751. is intended for removable media such as Syquests, ZIP drives, and
  752. magneto-optical disks. Although traditional DOS sees Syquests and
  753. magneto-optical disks as \fR\&\f(CW\(ifgiant floppy disks\(is\fR which are
  754. unpartitioned, OS/2 and Windows NT treat them like hard disks,
  755. i.e. partioned devices. The \fR\&\f(CWpartition\fR flag is also useful DOSEMU
  756. hdimages. It is not recommended for hard disks for which direct access
  757. to partitions is available through mounting.
  758. .TP
  759. \&\fR\&\f(CWscsi\fR\ 
  760. .iX "c setuid installation (needed for raw SCSI I/O)"
  761. .iX "c Solaris (Raw access to SCSI devices such as Zip & Jaz)"
  762. .iX "c SunOS (Raw access to SCSI devices such as Zip & Jaz)"
  763. .iX "c Zip disks (raw Scsi access)"
  764. .iX "c Jaz disks (raw Scsi access)"
  765. .iX "c Syquests (raw Scsi access)"
  766. .iX "c SCSI devices"
  767. When set to 1, this option tells mtools to use raw SCSI I/O instead of
  768. the standard read/write calls to access the device. Currently, this is
  769. supported on HP/UX, Solaris and SunOs.  This is needed because on some
  770. architectures, such as SunOs or Solaris, PC media can't be accessed
  771. using the \fR\&\f(CWread\fR and \fR\&\f(CWwrite\fR syscalls, because the OS expects
  772. them to contain a Sun specific "disk label".
  773. .IP
  774. As raw Scsi access always uses the whole device, you need to specify the
  775. "partition" flag in addition
  776. .IP
  777. On some architectures, such as Solaris, mtools needs root privileges to
  778. be able to use the \fR\&\f(CWscsi=1\fR option.  Thus mtools should be
  779. installed set uid root on Solaris if you want to access Zip/Jaz drives.
  780. Mtools uses its root privileges to open the device, and to issue the
  781. actual SCSI I/O calls.  Moreover, root privileges are only used for
  782. drives described in a system-wide configuration file such as
  783. \&\fR\&\f(CW\(if/usr/local/etc/mtools.conf\(is\fR, and not for those described in
  784. \&\fR\&\f(CW\(if~/.mtoolsrc\(is\fR or \fR\&\f(CW\(if$MTOOLSRC\(is\fR.
  785. .TP
  786. \&\fR\&\f(CWprivileged\fR\ 
  787. .iX "c setuid installation"
  788. .iX "c setgid installation"
  789. When set to 1, this instructs mtools to use its set-uid and set-gid
  790. privileges for opening the given drive.  This option is only valid for
  791. drives described in the system-wide configuration files (such as
  792. \&\fR\&\f(CW\(if/usr/local/etc/mtools.conf\(is\fR, not \fR\&\f(CW\(if~/.mtoolsrc\(is\fR or
  793. \&\fR\&\f(CW\(if$MTOOLSRC\(is\fR).  Obviously, this option is also a no op if mtools is
  794. not installed setuid or setgid.  This option is implied by 'scsi=1', but
  795. again only for drives defined in system-wide configuration files.
  796. Privileged may also be set explicitely to 0, in order to tell mtools not
  797. to use its privileges for a given drive even if \fR\&\f(CWscsi=1\fR is set.
  798. .IP
  799. Mtools only needs to be installed setuid if you use the
  800. \&\fR\&\f(CWprivileged\fR or \fR\&\f(CWscsi\fR drive variables.  If you do not use
  801. these options, mtools works perfectly well even when not installed
  802. setuid root.
  803. .TP
  804. \&\fR\&\f(CWnolock\fR\ 
  805. .iX "c disable locking"
  806. .iX "c locking (disabling it)"
  807. .iX "c plain floppy: device xxx busy"
  808. Instruct mtools to not use locking on this drive.  This is needed on
  809. systems with buggy locking semantics.  However, enabling this makes
  810. operation less safe in cases where several users may access the same
  811. drive at the same time.
  812. .TP
  813. \&\fR\&\f(CWoffset\fR\ 
  814. .iX "c Ram disk"
  815. .iX "c Atari Ram disk"
  816. Describes where in the file the MS-DOS filesystem starts. This is useful
  817. for logical partitions in DOSEMU hdimages, and for ATARI ram disks. By
  818. default, this is zero, meaning that the filesystem starts right at the
  819. beginning of the device or file.
  820. .TP
  821. \&\fR\&\f(CWfat_bits\fR\ 
  822. .iX "v fat_bits"
  823. The number of FAT bits. This may be 12 or 16. This is very rarely
  824. needed, as it can almost always be deduced from information in the
  825. boot sector. On the contrary, describing the number of fat bits may
  826. actually be harmful if you get it wrong. You should only use it if
  827. mtools gets the autodetected number of fat bits wrong, or if you want
  828. to mformat a disk with a weird number of fat bits.
  829. .TP
  830. \&\fR\&\f(CWprecmd\fR\ 
  831. .iX "c Solaris (volcheck)"
  832. .iX "c Executing commands before opening the device"
  833. .IP
  834. On some variants of Solaris, it is necessary to call 'volcheck -v'
  835. before opening a floppy device, in order for the system to notice that
  836. there is indeed a disk in the drive. \fR\&\f(CWprecmd="volcheck -v"\fR in the
  837. drive clause establishes the desired behavior.
  838. .PP
  839. Only the \fR\&\f(CWfile\fR variable is mandatory. The other parameters may
  840. be left out. In that case a default value or an autodetected value is
  841. used.
  842. .PP
  843. .SS \ \ Supplying\ multiple\ descriptions\ for\ a\ drive
  844. .PP
  845. It is possible to supply multiple descriptions for a drive. In that
  846. case, the descriptions are tried in order until one is found that
  847. fits. Descriptions may fail for several reasons:
  848. .TP
  849. 1.\ 
  850. because the geometry is not appropriate,
  851. .TP
  852. 2.\ 
  853. because there is no disk in the drive,
  854. .TP
  855. 3.\ 
  856. or because of other problems.
  857. .PP
  858. Multiple definitions are useful when using physical devices which are
  859. only able to support one single disk geometry.
  860. Example:
  861.  
  862. .nf
  863. .ft 3
  864. .in +0.3i
  865.   drive a: file="/dev/fd0H1440" 1.44m
  866.   drive a: file="/dev/fd0H720" 720k
  867. .fi
  868. .in -0.3i
  869. .ft R
  870. .lp
  871.  
  872. \&\fR
  873. .PP
  874. This instructs mtools to use /dev/fd0H1440 for 1.44m (high density)
  875. disks and /dev/fd0H720 for 720k (double density) disks. On Linux, this
  876. feature is not really needed, as the /dev/fd0 device is able to handle
  877. any geometry.
  878. .PP
  879. You may also use multiple drive descriptions to access both of your
  880. physical drives through one drive letter:
  881. .PP
  882.  
  883. .nf
  884. .ft 3
  885. .in +0.3i
  886.   drive z: file="/dev/fd0"
  887.   drive z: file="/dev/fd1"
  888. .fi
  889. .in -0.3i
  890. .ft R
  891. .lp
  892.  
  893. \&\fR
  894. .PP
  895. With this description, \fR\&\f(CWmdir z:\fR accesses your first physical
  896. drive if it contains a disk. If the first drive doesn't contain a disk,
  897. mtools checks the second drive.
  898. .PP
  899. When using multiple configuration files, drive descriptions in the files
  900. parsed last override descriptions for the same drive in earlier
  901. files. In order to avoid this, use the \fR\&\f(CWdrive+\fR or \fR\&\f(CW+drive\fR
  902. keywords instead of \fR\&\f(CWdrive\fR. The first adds a description to the
  903. end of the list (i.e. it will be tried last), and the first adds it to
  904. the start of the list.
  905. .PP
  906. .SS Character\ set\ translation\ tables
  907. .iX "c Internationalization"
  908. .iX "c Accented characters"
  909. .iX "c National character set"
  910. .PP
  911. If you live in the USA, in Western Europe or in Australia, you may
  912. skip this section.
  913. .PP
  914. .SS \ \ Why\ character\ set\ translation\ tables\ are\ needed
  915. .PP
  916. DOS uses a different character code mapping than Unix. 7-bit
  917. characters still have the same meaning, only characters with the eight
  918. bit set are affected. To make matters worse, there are several
  919. translation tables available depending on the country where you
  920. are. The appearance of the characters is defined using
  921. code pages. These code pages aren't the same for all countries. For
  922. instance, some code pages don't contain upper case accented
  923. characters. On the other hand, some code pages contain characters which
  924. don't exist in Unix, such as certain line-drawing characters or
  925. accented consonants used by some Eastern European countries. This
  926. affects two things, relating to filenames:
  927. .TP
  928. upper\ case\ characters\ 
  929. In short names, only upper case characters are allowed. This also
  930. holds for accented characters. For instance, in a code page which
  931. doesn't contain accented uppercase characters, the accented lowercase
  932. characters get transformed into their unaccented counterparts.
  933. .TP
  934. long\ file\ names\ 
  935. Micro$oft has finally come to their senses and uses a more standard
  936. mapping for the long file names. They use Unicode, which is basically
  937. a 32 bit version of ASCII. Its first 256 characters are identical to
  938. Unix ASCII. Thus, the code page also affects the correspondence
  939. between the codes used in long names and those used in short names
  940. .PP
  941. Mtools considers the filenames entered on the command line as having the
  942. Unix mapping, and translates the characters to get short names.  By
  943. default, code page 850 is used with the Swiss uppercase/lowercase
  944. mapping. I chose this code page, because its set of existing characters
  945. most closely matches Unix's. Moreover, this code page covers most
  946. characters in use in the USA, Australia and Western Europe. However, it
  947. is still possible to chose a different mapping. There are two methods:
  948. the \fR\&\f(CWcountry\fR variable and explicit tables.
  949. .PP
  950. .SS \ \ Configuration\ using\ Country
  951. .PP
  952. The \fR\&\f(CWCOUNTRY\fR variable is recommended for people which also have
  953. access to MS-DOS system files and documentation. If you don't have access
  954. to these, I'd suggest you'd rather use explicit tables instead.
  955. .PP
  956. Syntax:
  957. .PP
  958. \&\fR\&\f(CWCOUNTRY="\fR\fIcountry\fR\fR\&\f(CW[,[\fR\fIcodepage\fR\fR\&\f(CW],\fR
  959. \&\fIcountry-file\fR\fR\&\f(CW]"\fR
  960. .PP
  961. This tells mtools to use a Unix-to-DOS translation table which matches
  962. \&\fIcodepage\fR and an lowercase-to-uppercase table for \fIcountry\fR and
  963. to use the \fIcountry-file\fR file to get the lowercase-to-uppercase
  964. table. The country code is most often the telephone prefix of the
  965. country. Refer to the DOS help page on "country" for more details. The
  966. \&\fIcodepage\fR and the \fIcountry-file\fR parameters are
  967. optional. Please don't type in the square brackets, they are only there
  968. to say which parameters are optional. The \fIcountry-file\fR file is
  969. supplied with MS-DOS, and is usually called \fR\&\f(CW\(ifCOUNTRY.SYS\(is\fR, and
  970. stored in the \fR\&\f(CW\(ifC:\eDOS\(is\fR directory. In most cases you don't need it,
  971. as the most common translation tables are compiled into mtools. So,
  972. don't worry if you run a Unix-only box which lacks this file.
  973. .PP
  974. If \fIcodepage\fR is not given, a per country default code page is
  975. used. If the \fIcountry-file\fR parameter isn't given, compiled-in
  976. defaults are used for the lowercase-to-uppercase table. This is useful
  977. for other Unices than Linux, which may have no \fR\&\f(CW\(ifCOUNTRY.SYS\(is\fR file
  978. available online.
  979. .PP
  980. The Unix-to-DOS are not contained in the \fR\&\f(CW\(ifCOUNTRY.SYS\(is\fR file, and
  981. thus mtools always uses compiled-in defaults for those. Thus, only a
  982. limited amount of code pages are supported. If your preferred code page
  983. is missing, or if you know the name of the Windows 95 file which
  984. contains this mapping, could you please drop me a line at
  985. \&\fR\&\f(CWAlain.Knaff@poboxes.com\fR.
  986. .PP
  987. The \fR\&\f(CWCOUNTRY\fR variable can also be set using the environment.
  988. .PP
  989. .SS \ \ Configuration\ using\ explicit\ translation\ tables
  990. .PP
  991. Translation tables may be described in line in the configuration
  992. file. Two tables are needed: first the DOS-to-Unix table, and then the
  993. Lowercase-to-Uppercase table. A DOS-to-Unix table starts with the
  994. \&\fR\&\f(CWtounix\fR
  995. keyword, followed by a colon, and 128 hexadecimal numbers.
  996. A lower-to-upper table starts with the
  997. \&\fR\&\f(CWfucase\fR
  998. keyword, followed by a colon, and 128 hexadecimal numbers.
  999. .PP
  1000. The tables only show the translations for characters whose codes is
  1001. greater than 128, because translation for lower codes is trivial.
  1002. .PP
  1003. Example:
  1004. .iX "v tounix"
  1005. .iX "v fucase"
  1006. .PP
  1007.  
  1008. .nf
  1009. .ft 3
  1010. .in +0.3i
  1011.  tounix:
  1012.    0xc7 0xfc 0xe9 0xe2 0xe4 0xe0 0xe5 0xe7 
  1013.    0xea 0xeb 0xe8 0xef 0xee 0xec 0xc4 0xc5 
  1014.    0xc9 0xe6 0xc6 0xf4 0xf6 0xf2 0xfb 0xf9 
  1015.    0xff 0xd6 0xdc 0xf8 0xa3 0xd8 0xd7 0x5f 
  1016.    0xe1 0xed 0xf3 0xfa 0xf1 0xd1 0xaa 0xba 
  1017.    0xbf 0xae 0xac 0xbd 0xbc 0xa1 0xab 0xbb 
  1018.    0x5f 0x5f 0x5f 0x5f 0x5f 0xc1 0xc2 0xc0 
  1019.    0xa9 0x5f 0x5f 0x5f 0x5f 0xa2 0xa5 0xac 
  1020.    0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0xe3 0xc3 
  1021.    0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0xa4 
  1022.    0xf0 0xd0 0xc9 0xcb 0xc8 0x69 0xcd 0xce 
  1023.    0xcf 0x5f 0x5f 0x5f 0x5f 0x7c 0x49 0x5f 
  1024.    0xd3 0xdf 0xd4 0xd2 0xf5 0xd5 0xb5 0xfe 
  1025.    0xde 0xda 0xd9 0xfd 0xdd 0xde 0xaf 0xb4 
  1026.    0xad 0xb1 0x5f 0xbe 0xb6 0xa7 0xf7 0xb8 
  1027.    0xb0 0xa8 0xb7 0xb9 0xb3 0xb2 0x5f 0x5f 
  1028. \&\&
  1029.  fucase:
  1030.    0x80 0x9a 0x90 0xb6 0x8e 0xb7 0x8f 0x80 
  1031.    0xd2 0xd3 0xd4 0xd8 0xd7 0xde 0x8e 0x8f 
  1032.    0x90 0x92 0x92 0xe2 0x99 0xe3 0xea 0xeb 
  1033.    0x59 0x99 0x9a 0x9d 0x9c 0x9d 0x9e 0x9f 
  1034.    0xb5 0xd6 0xe0 0xe9 0xa5 0xa5 0xa6 0xa7 
  1035.    0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae 0xaf 
  1036.    0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 
  1037.    0xb8 0xb9 0xba 0xbb 0xbc 0xbd 0xbe 0xbf 
  1038.    0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc7 0xc7 
  1039.    0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf 
  1040.    0xd1 0xd1 0xd2 0xd3 0xd4 0x49 0xd6 0xd7 
  1041.    0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 
  1042.    0xe0 0xe1 0xe2 0xe3 0xe5 0xe5 0xe6 0xe8 
  1043.    0xe8 0xe9 0xea 0xeb 0xed 0xed 0xee 0xef 
  1044.    0xf0 0xf1 0xf2 0xf3 0xf4 0xf5 0xf6 0xf7 
  1045.    0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xff 
  1046. .fi
  1047. .in -0.3i
  1048. .ft R
  1049. .lp
  1050.  
  1051. \&\fR
  1052. .PP
  1053. The first table maps DOS character codes to Unix character codes. For
  1054. example, the DOS character number 129. This is a u with to dots on top
  1055. of it. To translate it into Unix, we look at the character number 1 in
  1056. the first table (1 = 129 - 128). This is 0xfc. (Beware, numbering
  1057. starts at 0).
  1058. The second table maps lower case DOS characters to upper case DOS
  1059. characters. The same lower case u with dots maps to character 0x9a,
  1060. which is an uppercase U with dots in DOS.
  1061. .PP
  1062. .SS \ \ Unicode\ characters\ greater\ than\ 256
  1063. If an existing MS-DOS name contains Unicode character greater than 256,
  1064. these are translated to underscores or to characters which are close
  1065. in visual appearance. For example, accented consonants are translated
  1066. into their unaccented counterparts. This translation is used for mdir
  1067. and for the Unix filenames generated by mcopy. Linux does support
  1068. Unicode too, but unfortunately too few applications support it yet to bother
  1069. with it in mtools. Most importantly, xterm can't display Unicode
  1070. yet. If there is sufficient demand, I might include support for
  1071. Unicode in the Unix filenames as well.
  1072. .PP
  1073. \&\fBCaution:\fR
  1074. When deleting files with mtools, the underscore matches all characters
  1075. which can't be represented in Unix. Be careful with mdel!
  1076. .PP
  1077. .SS Location\ of\ configuration\ files\ and\ parsing\ order
  1078. .iX "c Parsing order"
  1079. .iX "c Configuration file parsing order"
  1080. .iX "c Configuration file name (parsing order)"
  1081. .iX "c Name of configuration files (parsing order)"
  1082. .iX "c Location of configuration files (parsing order)"
  1083. .PP
  1084. The configuration files are parsed in the following order:
  1085. .TP
  1086. 1.\ 
  1087. compiled-in defaults
  1088. .TP
  1089. 2.\ 
  1090. \&\fR\&\f(CW\(if/usr/local/etc/mtools.conf\(is\fR
  1091. .TP
  1092. 3.\ 
  1093. \&\fR\&\f(CW\(if/etc/mtools\(is\fR
  1094. This is for backwards compatibility only, and is only parsed if
  1095. \&\fR\&\f(CW\(ifmtools.conf\(is\fR
  1096. doesn't exist.
  1097. .TP
  1098. 4.\ 
  1099. \&\fR\&\f(CW\(if~/.mtoolsrc\(is\fR.
  1100. .TP
  1101. 5.\ 
  1102. \&\fR\&\f(CW\(if$MTOOLSRC\(is\fR (file pointed by the \fR\&\f(CWMTOOLSRC\fR environmental
  1103. variable)
  1104. .PP
  1105. Options described in the later files override those described in the
  1106. earlier files. Drives defined in earlier files persist if they are not
  1107. overridden in the later files. For instance, drives A and B may be
  1108. defined in \fR\&\f(CW\(if/usr/local/etc/mtools.conf\(is\fR and drives C and D may be
  1109. defined in \fR\&\f(CW\(if~/.mtoolsrc\(is\fR However, if \fR\&\f(CW\(if~/.mtoolsrc\(is\fR also
  1110. defines drive A, this new description would override the description of
  1111. drive A in \fR\&\f(CW\(if/usr/local/etc/mtools.conf\(is\fR instead of adding to it. If
  1112. you want to add a new description to a drive already described in an
  1113. earlier file, you need to use either the \fR\&\f(CW+drive\fR or \fR\&\f(CWdrive+\fR
  1114. keyword.
  1115. .PP
  1116. .SS Backwards\ compatibility\ with\ old\ configuration\ file\ syntax
  1117. .iX "c Backwards compatibility"
  1118. .iX "c Old configuration file syntax"
  1119. .iX "c Configuration file, old syntax"
  1120. .PP
  1121. The syntax described herein is new for version \fR\&\f(CWmtools-3.0\fR. The
  1122. old line-oriented syntax is still supported. Each line beginning with a
  1123. single letter is considered to be a drive description using the old
  1124. syntax. Old style and new style drive sections may be mixed within the
  1125. same configuration file, in order to make upgrading easier. Support for
  1126. the old syntax will be phased out eventually, and in order to discourage
  1127. its use, I purposefully omit its description here.
  1128. .PP
  1129. .SH Command\ list
  1130. .iX "c Command list"
  1131. .iX "c List of available commands"
  1132. .PP
  1133.  This section describes the available mtools commands, and the command
  1134. line parameters that each of them accepts. Options which are common to
  1135. all mtools commands are not described here, \(ifarguments\(is for a
  1136. description of those.
  1137. .PP
  1138. .SS Mattrib
  1139. .iX "p mattrib"
  1140. .iX "c Changing file attributes"
  1141. .iX "c Hidden files"
  1142. .iX "c Read-only files (changing the attribute)"
  1143. .iX "c System files"
  1144. .iX "c Archive bit"
  1145. .PP
  1146. \&\fR\&\f(CWMattrib\fR is used to change MS-DOS file attribute flags. It has the
  1147. following syntax:
  1148. .PP
  1149. \&\fR\&\f(CWmattrib\fR [\fR\&\f(CW-a|+a\fR] [\fR\&\f(CW-h|+h\fR] [\fR\&\f(CW-r|+r\fR]
  1150. [\fR\&\f(CW-s|+s\fR] \fImsdosfile\fR [ \fImsdosfiles\fR \&... ]
  1151. .PP
  1152. \&\fR\&\f(CWMattrib\fR adds attribute flags to an MS-DOS file (with the
  1153. `\fR\&\f(CW+\fR' operator) or remove attribute flags (with the `\fR\&\f(CW-\fR'
  1154. operator).
  1155. .PP
  1156. \&\fR\&\f(CWMattrib\fR supports the following attribute bits:
  1157. .TP
  1158. \&\fR\&\f(CWa\fR\ 
  1159. Archive bit.  Used by some backup programs to indicate a new file.
  1160. .TP
  1161. \&\fR\&\f(CWr\fR\ 
  1162. Read-only bit.  Used to indicate a read-only file.  Files with this bit
  1163. set cannot be erased by \fR\&\f(CWDEL\fR nor modified.
  1164. .TP
  1165. \&\fR\&\f(CWs\fR\ 
  1166. System bit.  Used by MS-DOS to indicate a operating system file.
  1167. .TP
  1168. \&\fR\&\f(CWh\fR\ 
  1169. Hidden bit.  Used to make files hidden from \fR\&\f(CWDIR\fR.
  1170. .PP
  1171. .SS Mbadblocks
  1172. .PP
  1173. The \fR\&\f(CWmbadblocks\fR command is used to scan an MS-DOS floppy and mark
  1174. its unused bad blocks as bad. It uses the following syntax:
  1175. .PP
  1176. \&\fR\&\f(CWmbadblocks\fR \fIdrive\fR\fR\&\f(CW:\fR
  1177. .iX "p mbadblocks"
  1178. .iX "c Marking blocks as bad"
  1179. .iX "c Bad blocks"
  1180. .iX "c Read errors"
  1181. .PP
  1182. \&\fR\&\f(CWMbadblocks\fR scans an MS-DOS floppy for bad blocks. All unused bad
  1183. blocks are marked as such in the FAT. This is intended to be used right
  1184. after \fR\&\f(CWmformat\fR.  It is not intended to salvage bad disks.
  1185. .SS \ \ Bugs
  1186. \&\fR\&\f(CWMbadblocks\fR should (but doesn't yet :-( ) also try to salvage bad
  1187. blocks which are in use by reading them repeatedly, and then mark them
  1188. bad.
  1189. .PP
  1190. .SS Mcd
  1191. .iX "p mcd"
  1192. .iX "c Directory (changing)"
  1193. .iX "c Working directory"
  1194. .iX "c Current working directory (changing the)"
  1195. .iX "c Default directory (changing the)"
  1196. .iX "c Mcwd file"
  1197. .PP
  1198. The \fR\&\f(CWmcd\fR command is used to change the mtools working directory
  1199. on the MS-DOS disk. It uses the following syntax:
  1200. .PP
  1201.  
  1202. .nf
  1203. .ft 3
  1204. .in +0.3i
  1205. \&\fR\&\f(CWmcd [\fImsdosdirectory\fR\&\f(CW]
  1206. .fi
  1207. .in -0.3i
  1208. .ft R
  1209. .lp
  1210.  
  1211. \&\fR
  1212. .PP
  1213. Without arguments, \fR\&\f(CWmcd\fR reports the current device and working
  1214. directory.  Otherwise, \fR\&\f(CWmcd\fR changes the current device and current
  1215. working directory relative to an MS-DOS filesystem.
  1216. .PP
  1217. The environmental variable \fR\&\f(CWMCWD\fR may be used to locate the file
  1218. where the device and current working directory information is stored.
  1219. The default is \fR\&\f(CW\(if$HOME/.mcwd\(is\fR.  Information in this file is ignored
  1220. if the file is more than 6 hours old.
  1221. .PP
  1222. \&\fR\&\f(CWMcd\fR returns 0 on success or 1 on failure.
  1223. .PP
  1224. Unlike MS-DOS versions of \fR\&\f(CWCD\fR, \fR\&\f(CWmcd\fR can be used to change to
  1225. another device. It may be wise to remove old \fR\&\f(CW\(if.mcwd\(is\fR files at logout.
  1226. .PP
  1227. .SS Mcopy
  1228. .iX "p mcopy"
  1229. .iX "c Reading MS-DOS files"
  1230. .iX "c Writing MS-DOS files"
  1231. .iX "c Copying MS-DOS files"
  1232. .iX "c Concatenating MS-DOS files"
  1233. .iX "c Text files"
  1234. .iX "c CR/LF conversions"
  1235. .PP
  1236. The \fR\&\f(CWmcopy\fR command is used to copy MS-DOS files to and from
  1237. Unix. It uses the following syntax:
  1238. .PP
  1239.  
  1240. .nf
  1241. .ft 3
  1242. .in +0.3i
  1243. \&\fR\&\f(CWmcopy [\fR\&\f(CW-tnvmoOsSrRA] \fIsourcefile\fR\&\f(CW \fItargetfile\fR\&\f(CW
  1244. \&\fR\&\f(CWmcopy [\fR\&\f(CW-tnvmoOsSrRA] \fIsourcefile\fR\&\f(CW [ \fIsourcefiles\fR\&\f(CW\&... ] \fItargetdirectory\fR\&\f(CW
  1245. \&\fR\&\f(CWmcopy [\fR\&\f(CW-tnvm] \fIMSDOSsourcefile\fR\&\f(CW
  1246. .fi
  1247. .in -0.3i
  1248. .ft R
  1249. .lp
  1250.  
  1251. \&\fR
  1252. .PP
  1253. \&\fR\&\f(CWMcopy\fR copies the specified file to the named file, or copies
  1254. multiple files to the named directory.  The source and target can be
  1255. either MS-DOS or Unix files.
  1256. .PP
  1257. The use of a drive letter designation on the MS-DOS files, 'a:' for
  1258. example, determines the direction of the transfer.  A missing drive
  1259. designation implies a Unix file whose path starts in the current
  1260. directory.  If a source drive letter is specified with no attached file
  1261. name (e.g. \fR\&\f(CWmcopy a: .\fR), all files are copied from that drive.
  1262. .PP
  1263. If only a single, MS-DOS source parameter is provided (e.g. "mcopy
  1264. a:foo.exe"), an implied destination of the current directory
  1265. (`\fR\&\f(CW.\fR') is assumed.
  1266. .PP
  1267. A filename of `\fR\&\f(CW-\fR' means standard input or standard output, depending
  1268. on its position on the command line.
  1269. .PP
  1270. \&\fR\&\f(CWMcopy\fR accepts the following command line options:
  1271. .TP
  1272. \&\fR\&\f(CWQ\fR\ 
  1273. When mcopying multiple files, quits as soon as one copy fails (for
  1274. example due to lacking storage space on the target disk)
  1275. .TP
  1276. \&\fR\&\f(CWt\fR\ 
  1277. Text file transfer.  \fR\&\f(CWMcopy\fR translates incoming carriage
  1278. return/line feeds to line feeds.
  1279. .TP
  1280. \&\fR\&\f(CWn\fR\ 
  1281. No confirmation when overwriting Unix files.  \fR\&\f(CWMcopy\fR doesn't warn
  1282. the user when overwriting an existing Unix file.  In order to switch off
  1283. confirmation for DOS files, use \fR\&\f(CW-o\fR.
  1284. .TP
  1285. \&\fR\&\f(CWm\fR\ 
  1286. Preserve the file modification time. If the target file already exists,
  1287. and the \fR\&\f(CW-n\fR option is not in effect, \fR\&\f(CWmcopy\fR asks whether to
  1288. overwrite the file or to rename the new file (\(ifname clashes\(is) for
  1289. details).
  1290. .PP
  1291. .SS \ \ Bugs
  1292. Unlike MS-DOS, the '+' operator (append) from MS-DOS is not
  1293. supported. However, you may use \fR\&\f(CWmtype\fR to produce the same effect:
  1294.  
  1295. .nf
  1296. .ft 3
  1297. .in +0.3i
  1298. mtype a:file1 a:file2 a:file3 >unixfile
  1299. mtype a:file1 a:file2 a:file3 | mcopy - a:msdosfile
  1300. .fi
  1301. .in -0.3i
  1302. .ft R
  1303. .lp
  1304.  
  1305. \&\fR
  1306. .PP
  1307. .SS Mdel
  1308. .iX "p mdel"
  1309. .iX "c removing MS-DOS files"
  1310. .iX "c erasing MS-DOS files"
  1311. .iX "c deleting MS-DOS files"
  1312. .PP
  1313. The \fR\&\f(CWmdel\fR command is used to delete an MS-DOS file. Its syntax
  1314. is:
  1315. .PP
  1316. .(l I
  1317. \&\fR\&\f(CWmdel\fR [\fR\&\f(CW-v\fR] \fImsdosfile\fR [ \fImsdosfiles\fR \&...  ]
  1318. .)l
  1319.  
  1320. .PP
  1321. \&\fR\&\f(CWMdel\fR deletes files on an MS-DOS filesystem.
  1322. .PP
  1323. \&\fR\&\f(CWMdel\fR asks for verification prior to removing a read-only file.
  1324. .PP
  1325. .SS Mdeltree
  1326. .iX "p mdeltree"
  1327. .iX "c removing an MS-DOS directory recursively"
  1328. .iX "c erasing an MS-DOS directory recursively"
  1329. .iX "c deleting an MS-DOS directory recursively"
  1330. .iX "c recursively removing an MS-DOS directory"
  1331. .PP
  1332. The \fR\&\f(CWmdeltree\fR command is used to delete an MS-DOS file. Its syntax
  1333. is:
  1334. .PP
  1335. .(l I
  1336. \&\fR\&\f(CWmdeltree\fR [\fR\&\f(CW-v\fR] \fImsdosdirectory\fR [\fImsdosdirectories\fR\&...]
  1337. .)l
  1338.  
  1339. .PP
  1340. \&\fR\&\f(CWMdeltree\fR removes a directory and all the files and subdirectories
  1341. it contains from an MS-DOS filesystem. An error occurs if the directory
  1342. to be removed does not exist.
  1343. .PP
  1344. .SS Mdir
  1345. .iX "p mdir"
  1346. .iX "c Read-only files (listing them)"
  1347. .iX "c Listing a directory"
  1348. .iX "c Directory listing"
  1349. .PP
  1350. The \fR\&\f(CWmdir\fR command is used to display an MS-DOS directory. Its
  1351. syntax is:
  1352. .PP
  1353. \&\fR\&\f(CWmdir\fR [\fR\&\f(CW-w\fR] \fImsdosdirectory\fR
  1354. .PP
  1355. \&\fR\&\f(CWmdir\fR [\fR\&\f(CW-f\fR] [\fR\&\f(CW-w\fR] [\fR\&\f(CW-a\fR] \fImsdosfile\fR [ \fImsdosfiles\fR\&...] 
  1356. .PP
  1357. \&\fR\&\f(CWMdir\fR
  1358. displays the contents of an MS-DOS directory.
  1359. .PP
  1360. \&\fR\&\f(CWMdir\fR supports the following command line options:
  1361. .TP
  1362. \&\fR\&\f(CWw\fR\ 
  1363. Wide output.  With this option, \fR\&\f(CWmdir\fR prints the filenames across
  1364. the page without displaying the file size or creation date.
  1365. .TP
  1366. \&\fR\&\f(CWa\fR\ 
  1367. Also list hidden files.
  1368. .TP
  1369. \&\fR\&\f(CWf\fR\ 
  1370. Fast.  Do not try to find out free space.  On larger disks, finding out
  1371. the amount of free space takes up some non trivial amount of time, as
  1372. the whole FAT must be read in and scanned.  The \fR\&\f(CW-f\fR flag bypasses
  1373. this step.  This flag is not needed on FAT32 filesystems, which store
  1374. the size explicitely.
  1375. .PP
  1376. An error occurs if a component of the path is not a directory.
  1377. .PP
  1378. .SS Mformat
  1379. .iX "p mformat"
  1380. .iX "c Initializing disks"
  1381. .iX "c Formatting disks"
  1382. .iX "c Filesystem creation"
  1383. .PP
  1384. The \fR\&\f(CWmformat\fR command is used to add an MS-DOS filesystem to a
  1385. low-level formatted diskette. Its syntax is:
  1386. .PP
  1387. .(l I
  1388. \&\fR\&\f(CWmformat\fR [\fR\&\f(CW-t\fR \fIcylinders\fR] [\fR\&\f(CW-h\fR \fIheads\fR]
  1389. [\fR\&\f(CW-s\fR \fIsectors\fR] [\fR\&\f(CW-l\fR \fIvolume_label\fR] [\fR\&\f(CW-F\fR]
  1390. [\fR\&\f(CW-I\fR \fIfsVersion\fR] [\fR\&\f(CW-S\fR \fIsizecode\fR] [\fR\&\f(CW-2\fR
  1391. \&\fIsectors_on_track_0\fR] [\fR\&\f(CW-M\fR \fIsoftware_sector_size\fR]
  1392. [\fR\&\f(CW-a\fR] [\fR\&\f(CW-X\fR] [\fR\&\f(CW-C\fR] [\fR\&\f(CW-H\fR \fIhidden_sectors\fR]
  1393. [\fR\&\f(CW-r\fR \fIroot_sectors\fR] \fIdrive:\fR
  1394. .)l
  1395.  
  1396. .PP
  1397. \&\fR\&\f(CWMformat\fR adds a minimal MS-DOS filesystem (boot sector, FAT, and
  1398. root directory) to a diskette that has already been formatted by a Unix
  1399. low-level format.
  1400. .PP
  1401. The following options are supported: (The S, 2, 1 and M options may not
  1402. exist if this copy of mtools has been compiled without the USE_2M
  1403. option)
  1404. .TP
  1405. \&\fR\&\f(CWt\fR\ 
  1406. The number of cylinders.
  1407. .TP
  1408. \&\fR\&\f(CWh\fR\ 
  1409. The number of heads (sides).
  1410. .TP
  1411. \&\fR\&\f(CWs\fR\ 
  1412. The number of sectors per track. If the 2m option is given, number of
  1413. 512-byte sector equivalents on generic tracks (i.e. not head 0 track 0).
  1414. If the 2m option is not given, number of physical sectors per track
  1415. (which may be bigger than 512 bytes).
  1416. .TP
  1417. \&\fR\&\f(CWl\fR\ 
  1418. An optional volume label.
  1419. .TP
  1420. \&\fR\&\f(CWS\fR\ 
  1421. The sizecode. The size of the sector is 2 ^ (sizecode + 7).
  1422. .TP
  1423. \&\fR\&\f(CW2\fR\ 
  1424. 2m format. The parameter to this option describes the number of
  1425. sectors on track 0, head 0. This option is recommended for sectors
  1426. bigger than normal.
  1427. .TP
  1428. \&\fR\&\f(CW1\fR\ 
  1429. don't use a 2m format, even if the current geometry of the disk is a 2m 
  1430. geometry.
  1431. .TP
  1432. \&\fR\&\f(CWM\fR\ 
  1433. software sector size. This parameter describes the sector size in bytes used
  1434. by the MS-DOS filesystem. By default it is the physical sector size.
  1435. .TP
  1436. \&\fR\&\f(CWa\fR\ 
  1437. If this option is given, an Atari style serial number is generated.
  1438. Ataris store their serial number in the OEM label.
  1439. .TP
  1440. \&\fR\&\f(CWX\fR\ 
  1441. formats the disk as an XDF disk. See section XDF for more details. The
  1442. disk has first to be low-level formatted using the xdfcopy utility
  1443. included in the fdutils package.
  1444. .TP
  1445. \&\fR\&\f(CWC\fR\ 
  1446. creates the disk image file to install the MS-DOS filesystem on
  1447. it. Obviously, this is useless on physical devices such as floppies
  1448. and hard disk partitions.
  1449. .TP
  1450. \&\fR\&\f(CWH\fR\ 
  1451. number of hidden sectors. This parameter is useful for formatting hard
  1452. disk partition, which are not aligned on track boundaries (i.e. first
  1453. head of first track doesn't belong to the partition, but contains a
  1454. partition table). In that case the number of hidden sectors is in
  1455. general the number of sectors per cylinder. This is untested.
  1456. .TP
  1457. \&\fR\&\f(CWn\fR\ 
  1458. serial number
  1459. .TP
  1460. \&\fR\&\f(CWF\fR\ 
  1461. Format the partition as FAT32 (experimental).
  1462. .TP
  1463. \&\fR\&\f(CWI\fR\ 
  1464. Sets the fsVersion id when formatting a FAT32 drive.  In order to find
  1465. this out, run minfo on an existing FAT32 drive, and mail me about it, so
  1466. I can include the correct value in future versions of mtools.
  1467. .TP
  1468. \&\fR\&\f(CWc\fR\ 
  1469. Sets the size of a cluster (in sectors).  If this cluster size would
  1470. generate a FAT that too big for its number of bits, mtools automatically
  1471. increases the cluster size, until the FAT is small enough.
  1472. .TP
  1473. \&\fR\&\f(CWr\fR\ 
  1474. Sets the size of the root directory (in sectors).  Only applicable to 12
  1475. and 16 bit FATs.
  1476. .PP
  1477. To format a diskette at a density other than the default, you must supply
  1478. (at least) those command line parameters that are different from the
  1479. default.
  1480. .PP
  1481. \&\fR\&\f(CWMformat\fR returns 0 on success or 1 on failure.
  1482. .PP
  1483. It doesn't record bad block information to the Fat, use
  1484. \&\fR\&\f(CWmkmanifest\fR for that.
  1485. .PP
  1486. .SS Mkmanifest
  1487. .iX "p mkmanifest"
  1488. .iX "c packing list"
  1489. .PP
  1490. The \fR\&\f(CWmkmanifest\fR command is used to create a shell script (packing
  1491. list) to restore Unix filenames. Its syntax is:
  1492. .PP
  1493. \&\fR\&\f(CWmkmanifest\fR [ \fIfiles\fR ]
  1494. .PP
  1495. \&\fR\&\f(CWMkmanifest\fR creates a shell script that aids in the restoration of
  1496. Unix filenames that got clobbered by the MS-DOS filename restrictions.
  1497. MS-DOS filenames are restricted to 8 character names, 3 character
  1498. extensions, upper case only, no device names, and no illegal characters.
  1499. .PP
  1500. The mkmanifest program is compatible with the methods used in
  1501. \&\fR\&\f(CWpcomm, arc,\fR and \fR\&\f(CWmtools\fR to change perfectly good Unix
  1502. filenames to fit the MS-DOS restrictions. This command is only useful if
  1503. the target system which will read the diskette cannot handle vfat long
  1504. names.
  1505. .PP
  1506. .SS \ \ Example
  1507. You want to copy the following Unix files to a MS-DOS diskette (using the
  1508. \&\fR\&\f(CWmcopy\fR command).
  1509. .PP
  1510.  
  1511. .nf
  1512. .ft 3
  1513. .in +0.3i
  1514.   very_long_name
  1515.   2.many.dots
  1516.   illegal:
  1517.   good.c
  1518.   prn.dev
  1519.   Capital
  1520. .fi
  1521. .in -0.3i
  1522. .ft R
  1523. .lp
  1524.  
  1525. \&\fR
  1526. .PP
  1527. \&\fR\&\f(CWMcopy\fR
  1528. converts the names to:
  1529. .PP
  1530.  
  1531. .nf
  1532. .ft 3
  1533. .in +0.3i
  1534.   very_lon
  1535.   2xmany.dot
  1536.   illegalx
  1537.   good.c
  1538.   xprn.dev
  1539.   capital
  1540. .fi
  1541. .in -0.3i
  1542. .ft R
  1543. .lp
  1544.  
  1545. \&\fR
  1546. .PP
  1547. The command:
  1548.  
  1549. .nf
  1550. .ft 3
  1551. .in +0.3i
  1552. mkmanifest very_long_name 2.many.dots illegal: good.c prn.dev Capital >manifest
  1553. .fi
  1554. .in -0.3i
  1555. .ft R
  1556. .lp
  1557.  
  1558. \&\fRwould produce the following:
  1559.  
  1560. .nf
  1561. .ft 3
  1562. .in +0.3i
  1563.   mv very_lon very_long_name
  1564.   mv 2xmany.dot 2.many.dots
  1565.   mv illegalx illegal:
  1566.   mv xprn.dev prn.dev
  1567.   mv capital Capital
  1568. .fi
  1569. .in -0.3i
  1570. .ft R
  1571. .lp
  1572.  
  1573. \&\fR
  1574. .PP
  1575. Notice that "good.c" did not require any conversion, so it did not
  1576. appear in the output.
  1577. .PP
  1578. Suppose I've copied these files from the diskette to another Unix
  1579. system, and I now want the files back to their original names.  If the
  1580. file "manifest" (the output captured above) was sent along with those
  1581. files, it could be used to convert the filenames.
  1582. .PP
  1583. .SS \ \ Bugs
  1584. .PP
  1585. The short names generated by \fR\&\f(CWmkmanifest\fR follow the old convention
  1586. (from mtools-2.0.7) and not the one from Windows 95 and mtools-3.0.
  1587. .PP
  1588. .SS Minfo
  1589. .iX "p mlabel"
  1590. .iX "c mformat parameters"
  1591. .iX "c getting parameters of a Dos fs"
  1592. .PP
  1593. The \fR\&\f(CWminfo\fR command prints the parameters of a Dos filesystem, such
  1594. as number of sectors, heads and cylinders.  It also prints an mformat
  1595. command line which can be used to create a similar Dos filesystem on
  1596. another media.  However, this doesn't work with 2m or Xdf media, and
  1597. with Dos 1.0 filesystems
  1598. .(l I
  1599. \&\fR\&\f(CWminfo\fR \fIdrive\fR:
  1600. .)l
  1601.  
  1602. .PP
  1603. Mlabel supports the following option:
  1604. .TP
  1605. \&\fR\&\f(CWv\fR\ 
  1606. Prints a hexdump of the bootsector, in addition to the other information
  1607. .PP
  1608. .SS Mlabel
  1609. .iX "p mlabel"
  1610. .iX "c Labeling a disk"
  1611. .iX "c Disk label"
  1612. .PP
  1613. The \fR\&\f(CWmlabel\fR command adds a volume label to a disk. Its syntax is:
  1614. .(l I
  1615. \&\fR\&\f(CWmlabel\fR [\fR\&\f(CW-vcs\fR] \fIdrive\fR:[\fInew_label\fR]
  1616. .)l
  1617.  
  1618. .PP
  1619. \&\fR\&\f(CWMlabel\fR displays the current volume label, if present. If
  1620. \&\fInew_label\fR is not given, and if neither the \fR\&\f(CWc\fR nor the
  1621. \&\fR\&\f(CWs\fR options are set, it prompts the user for a new volume label.
  1622. To delete an existing volume label, press return at the prompt.
  1623. .PP
  1624. Reasonable care is taken to create a valid MS-DOS volume label.  If an
  1625. invalid label is specified, \fR\&\f(CWmlabel\fR changes the label (and
  1626. displays the new label if the verbose mode is set). \fR\&\f(CWMlabel\fR
  1627. returns 0 on success or 1 on failure.
  1628. .PP
  1629. Mlabel supports the following options:
  1630. .TP
  1631. \&\fR\&\f(CWc\fR\ 
  1632. Clears an existing label, without prompting the user
  1633. .TP
  1634. \&\fR\&\f(CWs\fR\ 
  1635. Shows the existing label, without prompting the user.
  1636. .PP
  1637. .SS Mmd
  1638. .iX "p mmd"
  1639. .iX "c Making a directory"
  1640. .iX "c Creating a directory"
  1641. .iX "c Directory creation"
  1642. .iX "c Subdirectory creation"
  1643. .PP
  1644. The \fR\&\f(CWmmd\fR command is used to make an MS-DOS subdirectory. Its
  1645. syntax is:
  1646. .PP
  1647. \&\fR\&\f(CWmmd\fR [\fR\&\f(CW-voOsSrRA\fR] \fImsdosdirectory\fR [
  1648. \&\fImsdosdirectories\fR\&... ]
  1649. .PP
  1650. \&\fR\&\f(CWMmd\fR makes a new directory on an MS-DOS filesystem. An error occurs
  1651. if the directory already exists.
  1652. .PP
  1653. .SS Mmount
  1654. .iX "p mmount"
  1655. .iX "c Linux enhancements (mmount)"
  1656. .iX "c Mounting a disk"
  1657. .iX "c High capacity formats, mounting"
  1658. .PP
  1659. The \fR\&\f(CWmmount\fR command is used to mount an MS-DOS disk. It is only
  1660. available on Linux, as it is only useful if the OS kernel allows to
  1661. configure the disk geometry. Its syntax is:
  1662. .PP
  1663. \&\fR\&\f(CWmmount\fR \fImsdosdrive\fR [\fImountargs\fR]
  1664. .PP
  1665. \&\fR\&\f(CWMmount\fR
  1666. reads the boot sector of an MS-DOS disk, configures the drive geometry,
  1667. and finally mounts it passing
  1668. \&\fR\&\f(CWmountargs\fR to \fR\&\f(CWmount. \fR
  1669. If no mount arguments are specified, the name of the device is
  1670. used. If the disk is write protected, it is automatically mounted read
  1671. only.
  1672. .PP
  1673. .SS Mmove
  1674. .iX "p mmove"
  1675. .iX "c Moving files (mmove)"
  1676. .iX "c Renaming files (mmove)"
  1677. .PP
  1678. The \fR\&\f(CWmmove\fR command is used to moves or renames an existing MS-DOS
  1679. file or subdirectory.
  1680. .(l I
  1681. \&\fR\&\f(CWmmove\fR [\fR\&\f(CW-voOsSrRA\fR] \fIsourcefile\fR \fItargetfile\fR
  1682. \&\fR\&\f(CWmmove\fR [\fR\&\f(CW-voOsSrRA\fR] \fIsourcefile\fR [ \fIsourcefiles\fR\&... ] \fItargetdirectory\fR
  1683. .)l
  1684.  
  1685. \&\fR\&\f(CWMmove\fR moves or renames an existing MS-DOS file or
  1686. subdirectory. Unlike the MS-DOS version of \fR\&\f(CWMOVE\fR, \fR\&\f(CWmmove\fR is
  1687. able to move subdirectories.
  1688. .PP
  1689. .SS Mpartition
  1690. .iX "p mpartition"
  1691. .iX "c partitions (creating)"
  1692. .iX "c Zip disks (partitioning them)"
  1693. .iX "c Jaz disks (partitioning them)"
  1694. .PP
  1695. The \fR\&\f(CWmpartition\fR command is used to create MS-DOS filesystems as
  1696. partitions.  This is intended to be used on non-Linux systems,
  1697. i.e. systems where fdisk and easy access to Scsi devices are not
  1698. available.  This command only works on drives whose partition variable
  1699. is set.
  1700. .PP
  1701. .(l I
  1702. \&\fR\&\f(CWmpartition\fR \fR\&\f(CW-p\fR \fIdrive\fR
  1703. \&\fR\&\f(CWmpartition\fR \fR\&\f(CW-r\fR \fIdrive\fR
  1704. \&\fR\&\f(CWmpartition\fR \fR\&\f(CW-I\fR \fIdrive\fR
  1705. \&\fR\&\f(CWmpartition\fR \fR\&\f(CW-a\fR \fIdrive\fR
  1706. \&\fR\&\f(CWmpartition\fR \fR\&\f(CW-d\fR \fIdrive\fR
  1707. \&\fR\&\f(CWmpartition\fR \fR\&\f(CW-c\fR [\fR\&\f(CW-s\fR \fIsectors\fR] [\fR\&\f(CW-h\fR \fIheads\fR]
  1708. [\fR\&\f(CW-t\fR \fIcylinders\fR] [\fR\&\f(CW-v\fR [\fR\&\f(CW-T\fR \fItype\fR] [\fR\&\f(CW-b\fR
  1709. \&\fIbegin\fR] [\fR\&\f(CW-l\fR length] [\fR\&\f(CW-f\fR]
  1710. \&\&
  1711. .)l
  1712.  
  1713. .PP
  1714. Mpartition supports the following operations:
  1715. .TP
  1716. \&\fR\&\f(CWp\fR\ 
  1717. Prints a command line to recreate the partition for the drive.  Nothing
  1718. is printed if the partition for the drive is not defined, or an
  1719. inconsistency has been detected.  If verbose (\fR\&\f(CW-v\fR) is also set,
  1720. prints the current partition table.
  1721. .TP
  1722. \&\fR\&\f(CWr\fR\ 
  1723. Removes the partition described by \fIdrive\fR.
  1724. .TP
  1725. \&\fR\&\f(CWI\fR\ 
  1726. Initializes the partition table, and removes all partitions.
  1727. .TP
  1728. \&\fR\&\f(CWc\fR\ 
  1729. Creates the partition described by \fIdrive\fR.
  1730. .TP
  1731. \&\fR\&\f(CWa\fR\ 
  1732. "Activates" the partition, i.e. makes it bootable.  Only one partition
  1733. can be bootable at a time.
  1734. .TP
  1735. \&\fR\&\f(CWd\fR\ 
  1736. "Desactivates" the partition, i.e. makes it unbootable.
  1737. .PP
  1738. If no operation is given, the current settings are printed.
  1739. .PP
  1740. For partition creations, the following options are available:
  1741. .TP
  1742. \&\fR\&\f(CWs\ \fIsectors\fR\&\f(CW\fR\ 
  1743. The number of sectors per track of the partition (which is also the
  1744. number of sectors per track for the whole drive).
  1745. .TP
  1746. \&\fR\&\f(CWh\ \fIheads\fR\&\f(CW\fR\ 
  1747. The number of heads of the partition (which is also the number of heads
  1748. for the whole drive).  By default, the geometry information (number of
  1749. sectors and heads) is figured out from neighbouring partition table
  1750. entries, or guessed from the size.
  1751. .TP
  1752. \&\fR\&\f(CWt\ \fIcylinders\fR\&\f(CW\fR\ 
  1753. The number of cylinders of the partition (not the number of cylinders of
  1754. the whole drive.
  1755. .TP
  1756. \&\fR\&\f(CWb\ \fIbegin\fR\&\f(CW\fR\ 
  1757. The starting offset of the partition, expressed in sectors. If begin is
  1758. not given, mpartition lets the partition begin at the start of the disk
  1759. (partition number 1), or immediately after the end of the previous
  1760. partition.
  1761. .TP
  1762. \&\fR\&\f(CWl\ \fIlength\fR\&\f(CW\fR\ 
  1763. The size (length) of the partition, expressed in sectors.  If end is not
  1764. given, mpartition figures out the size from the number of sectors, heads
  1765. and cylinders.  If these are not given either, it gives the partition
  1766. the biggest possible size, considering disk size and start of the next
  1767. partition.
  1768. .PP
  1769. The following option is available for all operation which modify the
  1770. partition table:
  1771. .TP
  1772. \&\fR\&\f(CWf\fR\ 
  1773. Usually, before writing back any changes to the partition, mpartition
  1774. performs certain consistenct checks, such as checking for overlaps and
  1775. proper alignment of the partitions.  If any of these checks fails, the
  1776. partition table is not changes.  The \fR\&\f(CW-f\fR allows you to override
  1777. these safeguards.
  1778. .PP
  1779. The following option is available for all operations:
  1780. .TP
  1781. \&\fR\&\f(CWv\fR\ 
  1782. Together with \fR\&\f(CW-p\fR prints the partition table as it is now (no
  1783. change operation), or as it is after it is modified.
  1784. .TP
  1785. \&\fR\&\f(CWvv\fR\ 
  1786. If the verbosity flag is given twice, mpartition will print out a
  1787. hexdump of the partition table when reading it from and writing it to
  1788. the device.
  1789. .PP
  1790. .SS Mrd
  1791. .iX "p mrd"
  1792. .iX "c Removing a directory"
  1793. .iX "c Erasing a directory"
  1794. .iX "c Deleting a directory"
  1795. .iX "c Directory removing"
  1796. .iX "c Subdirectory removing"
  1797. .PP
  1798. The \fR\&\f(CWmrd\fR command is used to remove an MS-DOS subdirectory. Its
  1799. syntax is:
  1800. .PP
  1801. .(l I
  1802. \&\fR\&\f(CWmrd\fR [\fR\&\f(CW-v\fR] \fImsdosdirectory\fR [ \fImsdosdirectories\fR\&... ]
  1803. .)l
  1804.  
  1805. .PP
  1806. \&\fR\&\f(CWMrd\fR removes a directory from an MS-DOS filesystem. An error occurs
  1807. if the directory does not exist or is not empty.
  1808. .PP
  1809. .SS Mren
  1810. .iX "p mren"
  1811. .iX "c Renaming files (mren)"
  1812. .iX "c Moving files (mren)"
  1813. .PP
  1814. The \fR\&\f(CWmren\fR command is used to rename or move an existing MS-DOS
  1815. file or subdirectory. Its syntax is:
  1816. .PP
  1817. .(l I
  1818. \&\fR\&\f(CWmren\fR [\fR\&\f(CW-voOsSrRA\fR] \fIsourcefile\fR \fItargetfile\fR
  1819. .)l
  1820.  
  1821. .PP
  1822. \&\fR\&\f(CWMren\fR
  1823. renames an existing file on an MS-DOS filesystem.
  1824. .PP
  1825. In verbose mode, \fR\&\f(CWMren\fR displays the new filename if the name
  1826. supplied is invalid.
  1827. .PP
  1828. If the first syntax is used (only one sourcefile), and if the target
  1829. name doesn't contain any slashes or colons, the file (or subdirectory)
  1830. is renamed in the same directory, instead of being moved to the current
  1831. \&\fR\&\f(CWmcd\fR directory as would be the case with \fR\&\f(CWmmove\fR. Unlike the
  1832. MS-DOS version of \fR\&\f(CWREN\fR, \fR\&\f(CWmren\fR can be used to rename
  1833. directories.
  1834. .PP
  1835. .SS Mtoolstest
  1836. .iX "p mtoolstest"
  1837. .iX "c Testing configuration file for correctness"
  1838. .iX "c Checking configuration file"
  1839. .iX "c Verifying configuration file"
  1840. .PP
  1841. The \fR\&\f(CWmtoolstest\fR command is used to tests the mtools configuration
  1842. files. To invoke it, just type \fR\&\f(CWmtoolstest\fR without any arguments.
  1843. \&\fR\&\f(CWMtoolstest\fR reads the mtools configuration files, and prints the
  1844. cumulative configuration to \fR\&\f(CWstdout\fR. The output can be used as a
  1845. configuration file itself (although you might want to remove redundant
  1846. clauses).  You may use this program to convert old-style configuration
  1847. files into new style configuration files.
  1848. .PP
  1849. .SS Mtype
  1850. .PP
  1851. The \fR\&\f(CWmtype\fR command is used to display contents of an MS-DOS
  1852. file. Its syntax is:
  1853. .PP
  1854. .(l I
  1855. \&\fR\&\f(CWmtype\fR [\fR\&\f(CW-ts\fR] \fImsdosfile\fR [ \fImsdosfiles\fR\&... ]
  1856. .)l
  1857.  
  1858. .PP
  1859. \&\fR\&\f(CWMtype\fR displays the specified MS-DOS file on the screen.
  1860. .PP
  1861. In addition to the standard options, \fR\&\f(CWMtype\fR allows the following
  1862. command line options:
  1863. .TP
  1864. \&\fR\&\f(CWt\fR\ 
  1865. Text file viewing.  \fR\&\f(CWMtype\fR translates incoming carriage
  1866. return/line feeds to line feeds.
  1867. .TP
  1868. \&\fR\&\f(CWs\fR\ 
  1869. \&\fR\&\f(CWMtype\fR strips the high bit from the data.
  1870. .PP
  1871. The \fR\&\f(CWmcd\fR command may be used to establish the device and the
  1872. current working directory (relative to MS-DOS), otherwise the default is
  1873. \&\fR\&\f(CWA:/\fR.
  1874. .PP
  1875. \&\fR\&\f(CWMtype\fR returns 0 on success, 1 on utter failure, or 2 on partial
  1876. failure.
  1877. .PP
  1878. Unlike the MS-DOS version of \fR\&\f(CWTYPE\fR, \fR\&\f(CWmtype\fR allows multiple
  1879. arguments.
  1880. .PP
  1881. .SS Mzip
  1882. .iX "c Zip disk (utilities)"
  1883. .iX "c Jaz disk (utilities)"
  1884. .iX "c Ejecting a Zip/Jaz disk"
  1885. .iX "c Write protecting a Zip/Jaz disk"
  1886. .iX "p mzip"
  1887. .iX "c ZipTools disk"
  1888. .iX "c password protected Zip disks"
  1889. .PP
  1890. The \fR\&\f(CWmzip\fR command is used to issue ZIP disk specific commands on
  1891. Solaris or HPUX. Its syntax is:
  1892. .PP
  1893. .(l I
  1894. \&\fR\&\f(CWmzip\fR [\fR\&\f(CW-epqrwx\fR]
  1895. .)l
  1896.  
  1897. .PP
  1898. \&\fR\&\f(CWMzip\fR allows the following
  1899. command line options:
  1900. .TP
  1901. \&\fR\&\f(CWe\fR\ 
  1902. Ejects the disk.
  1903. .TP
  1904. \&\fR\&\f(CWf\fR\ 
  1905. Force eject even if the disk is mounted.
  1906. .TP
  1907. \&\fR\&\f(CWr\fR\ 
  1908. Write protect the disk.
  1909. .TP
  1910. \&\fR\&\f(CWw\fR\ 
  1911. Remove write protection.
  1912. .TP
  1913. \&\fR\&\f(CWp\fR\ 
  1914. Password write protect.
  1915. .TP
  1916. \&\fR\&\f(CWx\fR\ 
  1917. Password protect
  1918. .TP
  1919. \&\fR\&\f(CWq\fR\ 
  1920. Queries the status
  1921. .PP
  1922. To remove the password, set it to one of the passwordless modes
  1923. \&\fR\&\f(CW-r\fR or \fR\&\f(CW-w\fR: mzip will then ask you for the password, and
  1924. unlock the disk.  If you have forgotten the password, you can get rid of
  1925. it by low-level formatting the disk (using your SCSI adaptor's BIOS
  1926. setup).  The ZipTools disk included with the drive is also password
  1927. protected.  This password is automatically removed once the ZipTools
  1928. have been installed.
  1929. .PP
  1930. .SS Xcopy
  1931. .iX "c recursive copy"
  1932. .iX "c xcopy"
  1933. .iX "p xcopy"
  1934. .PP
  1935. The \fR\&\f(CWxcopy\fR script is used to recursively copy one directory to
  1936. another. Its syntax is:
  1937. .PP
  1938. .(l I
  1939. \&\fR\&\f(CWxcopy\fR \fIsourcedirectory\fR \fItargetdirectory\fR
  1940. .)l
  1941.  
  1942. .PP
  1943. If targetdirectory does not exist, it is created.  If it does exist, the
  1944. files of sourcedirectory are directly copied into it, and no
  1945. subdirectory called \fIsourcedirectory\fR is created, unlike with
  1946. \&\fR\&\f(CWcp -rf\fR.
  1947. .PP
  1948. .SS \ \ Bugs
  1949. .PP
  1950. This command is a big kludge.  A proper implementation would take a
  1951. rework of significant parts of mtools, but unfortunately I don't have
  1952. the time for this right now. The main downside of this implementation is
  1953. that it is inefficient on some architectures (several successive calls
  1954. to mtools, which defeats mtools' caching).
  1955. .PP
  1956. .SH Architecture\ specific\ compilation\ flags
  1957. .iX "c XDF disks (compile time configuration)"
  1958. .iX "c Solaris (compile time configuration of vold)"
  1959. .iX "c Vold (compile time configuration)"
  1960. .iX "c Compile time configuration"
  1961. .PP
  1962. To compile mtools, first invoke \fR\&\f(CW./configure\fR before
  1963. \&\fR\&\f(CWmake\fR. In addition to the standard \fR\&\f(CWautoconfigure\fR flags,
  1964. there are two architecture specific flags available.
  1965. .TP
  1966. \&\fR\&\f(CW./configure\ --enable-xdf\fR\ 
  1967. .TQ
  1968. \&\fR\&\f(CW./configure\ --disable-xdf\fR
  1969. Enables support for XDF disks. This is on by default. See section XDF,
  1970. for details.
  1971. .TP
  1972. \&\fR\&\f(CW./configure\ --enable-vold\fR\ 
  1973. .TQ
  1974. \&\fR\&\f(CW./configure\ --disable-vold\fR
  1975. Enables support for vold on Solaris. When used in conjunction with vold,
  1976. mtools should uses different device nodes as for direct access.
  1977. .PP
  1978. .SH Porting\ mtools\ to\ architectures\ which\ are\ not\ supported\ yet
  1979. .iX "c Porting"
  1980. .iX "c Compiled-in defaults"
  1981. .PP
  1982.  This chapter is only interesting for those who want to port mtools to
  1983. an architecture which is not yet supported. For most common systems,
  1984. default drives are already defined. If you want to add default drives
  1985. for a still unsupported system, run config.guess, to see which
  1986. identification autoconf uses for that system. This identification is
  1987. of the form cpu-vendor-os (for example sparc-sun-sunos). The cpu and
  1988. the os parts are passed to the compiler as preprocessor flags.
  1989.  The OS part is passed to the compiler in three forms.
  1990. .TP
  1991. 1.\ 
  1992. The complete os name, with dots replaced by underscores.  sco3.2v2 would
  1993. yield sco3_2v2
  1994. .TP
  1995. 2.\ 
  1996. The base os name. Sco3.2v2 would yield Sco
  1997. .TP
  1998. 3.\ 
  1999. The base os name plus its major version. Sco3.2v2 would yield Sco3
  2000. .PP
  2001.  All three versions are passed, if they are different.
  2002. .PP
  2003.  To define the devices, use the entries for the systems that are already
  2004. present as templates. In general, they have the following form:
  2005. .PP
  2006.  
  2007. .nf
  2008. .ft 3
  2009. .in +0.3i
  2010. #if (defined (my_cpu) && defined(my_os))
  2011. #define predefined_devices
  2012. struct device devices[] = {
  2013.         { "/dev/first_drive", 'drive_letter', drive_description},
  2014.         \&... 
  2015.         { "/dev/last_drive", 'drive_letter', drive_description}
  2016. }
  2017. #define INIT_NOOP
  2018. #endif
  2019. .fi
  2020. .in -0.3i
  2021. .ft R
  2022. .lp
  2023.  
  2024. \&\fR
  2025. .PP
  2026.  "/dev/first_drive" is the name of the device or image file
  2027. representing the drive. Drive_letter is a letter ranging from a to z
  2028. giving access to the drive. Drive_description describes the type of the
  2029. drive:
  2030. .TP
  2031. \&\fR\&\f(CWED312\fR\ 
  2032. extra density (2.88M) 3 1/2 disk
  2033. .TP
  2034. \&\fR\&\f(CWHD312\fR\ 
  2035. high density 3 1/2 disk
  2036. .TP
  2037. \&\fR\&\f(CWDD312\fR\ 
  2038. double density 3 1/2 disk
  2039. .TP
  2040. \&\fR\&\f(CWHD514\fR\ 
  2041. high density 5 1/4 disk
  2042. .TP
  2043. \&\fR\&\f(CWDD514\fR\ 
  2044. double density 5 1/4 disk
  2045. .TP
  2046. \&\fR\&\f(CWDDsmall\fR\ 
  2047. 8 sector double density 5 1/4 disk
  2048. .TP
  2049. \&\fR\&\f(CWSS514\fR\ 
  2050. single sided double density 5 1/4 disk
  2051. .TP
  2052. \&\fR\&\f(CWSSsmall\fR\ 
  2053. single sided 8 sector double density 5 1/4 disk
  2054. .TP
  2055. \&\fR\&\f(CWGENFD\fR\ 
  2056. generic floppy drive (12 bit FAT)
  2057. .TP
  2058. \&\fR\&\f(CWGENHD\fR\ 
  2059. generic hard disk (16 bit FAT)
  2060. .TP
  2061. \&\fR\&\f(CWGEN\fR\ 
  2062. generic device (all parameters match)
  2063. .TP
  2064. \&\fR\&\f(CWZIPJAZ(flags)\fR\ 
  2065. generic ZIP drive using normal access. This uses partition 4.
  2066. \&\fR\&\f(CWFlags\fR are any special flags to be passed to open.
  2067. .TP
  2068. \&\fR\&\f(CWRZIPJAZ(flags)\fR\ 
  2069. generic ZIP drive using raw SCSI access. This uses partition 4.
  2070. \&\fR\&\f(CWFlags\fR are any special flags to be passed to open.
  2071. .PP
  2072.  Entries may be described in more detail:
  2073.  
  2074. .nf
  2075. .ft 3
  2076. .in +0.3i
  2077.  fat_bits,open_flags,cylinders,heads,sectors,DEF_ARG
  2078. .fi
  2079. .in -0.3i
  2080. .ft R
  2081. .lp
  2082.  
  2083. \&\fR or, if you need to describe an offset (filesystem doesn't start at
  2084. beginning of filesystem)
  2085.  
  2086. .nf
  2087. .ft 3
  2088. .in +0.3i
  2089.  fat_bits, open_flags, cylinders, heads, sectors, offset, DEF_ARG0
  2090. .fi
  2091. .in -0.3i
  2092. .ft R
  2093. .lp
  2094.  
  2095. \&\fR
  2096. .TP
  2097. \&\fR\&\f(CWfat_bits\fR\ 
  2098. is either 12, 16 or 0. 0 means that the device accepts both types of
  2099. FAT.
  2100. .TP
  2101. \&\fR\&\f(CWopen_flags\fR\ 
  2102. may include flags such as O_NDELAY, or O_RDONLY, which might be
  2103. necessary to open the device. 0 means no special flags are needed.
  2104. .TP
  2105. \&\fR\&\f(CWcylinders,heads,sectors\fR\ 
  2106. describe the geometry of the disk. If cylinders is 0, the heads and sectors
  2107. parameters are ignored, and the drive accepts any geometry.
  2108. .TP
  2109. \&\fR\&\f(CWoffset\ \fR\ 
  2110. is used if the DOS filesystem doesn't begin at the start of the device
  2111. or image file. This is mostly useful for Atari Ram disks (which contain
  2112. their device driver at the beginning of the file) or for DOS emulator
  2113. images (which may represent a partitioned device.
  2114. .PP
  2115.  Definition of defaults in the devices file should only be done if these
  2116. same devices are found on a large number of hosts of this type. In that
  2117. case, could you also let me know about your new definitions, so that I
  2118. can include them into the next release.  For purely local file, I
  2119. recommend that you use the \fR\&\f(CW/usr/local/etc/mtools.conf\fR and
  2120. \&\fR\&\f(CW~/.mtoolsrc\fR configuration files.
  2121. .PP
  2122.  However, the devices files also allows to supply geometry setting
  2123. routines. These are necessary if you want to access high capacity
  2124. disks.
  2125. .PP
  2126.  Two routines should be supplied:
  2127. .TP
  2128. 1.\ 
  2129. Reading the current parameters
  2130.  
  2131. .nf
  2132. .ft 3
  2133. .in +0.3i
  2134. static inline int get_parameters(int fd, struct generic_floppy_struct *floppy)
  2135. .fi
  2136. .in -0.3i
  2137. .ft R
  2138. .lp
  2139.  
  2140. \&\fR
  2141. .IP
  2142.  This probes the current configured geometry, and return it in
  2143. the structure generic_floppy_struct (which must also be declared).
  2144.  Fd is an open file descriptor for the device, and buf is an already
  2145. filled in stat structure, which may be useful.
  2146.  This routine should return 1 if the probing fails, and 0 otherwise.
  2147. .TP
  2148. 2.\ 
  2149. Setting new parameters
  2150.  
  2151. .nf
  2152. .ft 3
  2153. .in +0.3i
  2154. static inline int set_parameters(int fd, struct generic_floppy_struct *floppy)
  2155.                                  struct stat *buf)
  2156. .fi
  2157. .in -0.3i
  2158. .ft R
  2159. .lp
  2160.  
  2161. \&\fR This configures the geometry contained in floppy on the file descriptor
  2162. fd. Buf is the result of a stat call (already filled in).  This should
  2163. return 1 if the new geometry cannot be configured, and 0 otherwise.
  2164. .PP
  2165.  A certain number of preprocessor macros should also be supplied:
  2166. .TP
  2167. \&\fR\&\f(CWTRACKS(floppy)\fR\ 
  2168. refers to the track field in the floppy structure
  2169. .TP
  2170. \&\fR\&\f(CWHEADS(floppy)\fR\ 
  2171. refers to the heads field in the floppy structure
  2172. .TP
  2173. \&\fR\&\f(CWSECTORS(floppy)\fR\ 
  2174. refers to the sectors per track field in the floppy structure
  2175. .TP
  2176. \&\fR\&\f(CWSECTORS_PER_DISK(floppy)\fR\ 
  2177. refers to the sectors per disk field in the floppy structure (if
  2178. applicable, otherwise leave undefined)
  2179. .TP
  2180. \&\fR\&\f(CWBLOCK_MAJOR\fR\ 
  2181. major number of the floppy device, when viewed as a block device
  2182. .TP
  2183. \&\fR\&\f(CWCHAR_MAJOR\fR\ 
  2184. major number of the floppy device, when viewed as a character device
  2185. (a.k.a. "raw" device, used for fsck) (leave this undefined, if your OS
  2186. doesn't have raw devices)
  2187. .PP
  2188.  For the truly high capacity formats (XDF, 2m, etc), there is no clean
  2189. and documented interface yet.
  2190. .SH See also
  2191. mattrib
  2192. mbadblocks
  2193. mcd
  2194. mcopy
  2195. mdel
  2196. mdeltree
  2197. mdir
  2198. mformat
  2199. mkmanifest
  2200. mlabel
  2201. mmd
  2202. mmount
  2203. mmove
  2204. mrd
  2205. mread
  2206. mren
  2207. mtoolstest
  2208. mtype
  2209. mwrite
  2210.