Penguin
Annotated edit history of mtools(1) version 2 showing authors affecting page license. View with all changes included.
Rev Author # Line
1 perry 1 mtools.1
2 !!!mtools.1
3 Name
4 Introduction
5 Where to get mtools
6 Common features of all mtools commands
7 See also
8 ----
9 !!Name
10
11
12 mtools - utilities to access DOS disks in Unix.
13 !!Introduction
14
15
16 Mtools is a public domain collection of tools to allow Unix
17 systems to manipulate MS-DOS files: read, write, and move
18 around files on an MS-DOS filesystem (typically a floppy
19 disk). Where reasonable, each program attempts to emulate
20 the MS-DOS equivalent command. However, unnecessary
21 restrictions and oddities of DOS are not emulated. For
22 instance, it is possible to move subdirectories from one
23 subdirectory to another.
24
25
26 Mtools is sufficient to give access to MS-DOS filesystems.
27 For instance, commands such as mdir a: work on the
28 a: floppy without any preliminary mounting or
29 initialization (assuming the default
30 `/etc/mtools.conf' works on your machine). With
31 mtools, one can change floppies too without unmounting and
32 mounting.
33 !!Where to get mtools
34
35
36 Mtools can be found at the following places (and their
37 mirrors):
38
39
40 __ http://mtools.linux.lu/mtools-3.9.8.tar.gz
41 ftp://www.tux.org/pub/knaff/mtools/mtools-3.9.8.tar.gz
42 ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-3.9.8.tar.gz
43 __
44
45
46 Before reporting a bug, make sure that it has not yet been
47 fixed in the Alpha patches which can be found
48 at:
49
50
51 __ http://mtools.linux.lu/
52 ftp://www.tux.org/pub/knaff/mtools
53 __
54
55
56 These patches are named
57 mtools-''version''-''ddmm''.taz,
58 where version stands for the base version, ''dd'' for the
59 day and ''mm'' for the month. Due to a lack of space, I
60 usually leave only the most recent patch.
61
62
63 There is an mtools mailing list at mtools @ tux.org . Please
64 send all bug reports to this list. You may subscribe to the
65 list by sending a message with 'subscribe mtools @ tux.org'
66 in its body to majordomo @ tux.org . (N.B. Please remove the
67 spaces around the
68 !!Common features of all mtools commands
69
70
71 __Options and filenames__
72
73
74 MS-DOS filenames are composed of a drive letter followed by
75 a colon, a subdirectory, and a filename. Only the filename
76 part is mandatory, the drive letter and the subdirectory are
77 optional. Filenames without a drive letter refer to Unix
78 files. Subdirectory names can use either the '/' or
79 '\' separator. The use of the '\'
80 separator or wildcards requires the names to be enclosed in
81 quotes to protect them from the shell. However, wildcards in
82 Unix filenames should not be enclosed in quotes, because
83 here we __want__ the shell to expand them.
84
85
86 The regular expression
87 *'
88 matches all MS-DOS files in lieu of `*.*'. The
89 archive, hidden, read-only and system attribute bits are
90 ignored during pattern matching.
91
92
93 All options use the - (minus) as their first
94 character, not / as you'd expect in
95 MS-DOS.
96
97
98 Most mtools commands allow multiple filename parameters,
99 which doesn't follow MS-DOS conventions, but which is more
100 user-friendly.
101
102
103 Most mtools commands allow options that instruct them how to
104 handle file name clashes. See section name clashes, for more
105 details on these. All commands accept the -V flags
106 which prints the version, and most accept the -v
107 flag, which switches on verbose mode. In verbose mode, these
108 commands print out the name of the MS-DOS files upon which
109 they act, unless stated otherwise. See section Commands, for
110 a description of the options which are specific to each
111 command.
112
113
114 __Drive letters__
115
116
117 The meaning of the drive letters depends on the target
118 architectures. However, on most target architectures, drive
119 A is the first floppy drive, drive B is the second floppy
120 drive (if available), drive J is a Jaz drive (if available),
121 and drive Z is a Zip drive (if available). On those systems
122 where the device name is derived from the SCSI id, the Jaz
123 drive is assumed to be at Scsi target 4, and the Zip at Scsi
124 target 5 (factory default settings). On Linux, both drives
125 are assumed to be the second drive on the Scsi bus
126 (/dev/sdb). The default settings can be changes using a
127 configuration file (see section Configuration).
128
129
130 __Current working directory__
131
132
133 The mcd command (`mcd') is used to establish the
134 device and the current working directory (relative to the
135 MS-DOS filesystem), otherwise the default is assumed to be
136 A:/. However, unlike MS-DOS, there is only one
137 working directory for all drives, and not one per
138 drive.
139
140
141 __VFAT-style long file names__
142
143
144 This version of mtools supports VFAT style long filenames.
145 If a Unix filename is too long to fit in a short DOS name,
146 it is stored as a VFAT long name, and a companion short name
147 is generated. This short name is what you see when you
148 examine the disk with a pre-7.0 version of DOS. The
149 following table shows some examples of short
150 names:
151
152
153 __ Long name MS-DOS name Reason for the change
154 --------- ---------- ---------------------
155 thisisatest THISIS~1 filename too long
156 alain.knaff ALAIN~1.KNA extension too long
157 prn.txt PRN~1.TXT PRN is a device name
158 .abc ABC~1 null filename
159 hot+cold HOT_CO~1 illegal character
160 __
161
162
163 As you see, the following transformations happen to derive a
164 short name:
165
166
167 *
168
169
170 Illegal characters are replaced by underscores. The illegal
171 characters are
172 ;+=[[]',.
173
174
175 *
176
177
178 Extra dots, which cannot be interpreted as a main
179 name/extension separator are removed
180
181
182 *
183
184
185 A ~''n'' number is generated,
186
187
188 *
189
190
191 The name is shortened so as to fit in the 8+3
192 limitation
193
194
195 The initial Unix-style file name (whether long or short) is
196 also called the ''primary'' name, and the derived short
197 name is also called the ''secondary'' name.
198
199
200 Example:
201
202
203 __ mcopy /etc/motd a:Reallylongname
204 __Mtools creates a VFAT entry for Reallylongname, and uses REALLYLO as a short name. Reallylongname is the primary name, and REALLYLO is the secondary name.
205
206
207 __ mcopy /etc/motd a:motd
208 __Motd fits into the DOS filename limits. Mtools doesn't need to derivate another name. Motd is the primary name, and there is no secondary name.
209
210
211 In a nutshell: The primary name is the long name, if one
212 exists, or the short name if there is no long
213 name.
214
215
216 Although VFAT is much more flexible than FAT, there are
217 still names that are not acceptable, even in VFAT. There are
218 still some illegal characters left
219 (), and device names are still
220 reserved.
221
222
223 __ Unix name Long name Reason for the change
224 --------- ---------- ---------------------
225 prn prn-1 PRN is a device name
226 ab:c ab_c-1 illegal character
227 __
228
229
230 As you see, the following transformations happen if a long
231 name is illegal:
232
233
234 *
235
236
237 Illegal characters are replaces by underscores,
238
239
240 *
241
242
243 A -''n'' number is generated,
244
245
246 __Name clashes__
247
248
249 When writing a file to disk, its long name or short name may
250 collide with an already existing file or directory. This may
251 happen for all commands which create new directory entries,
252 such as mcopy, mmd, mren,
253 mmove. When a name clash happens, mtools asks you
254 what it should do. It offers several choices:
255
256
257 overwrite
258
259
260 Overwrites the existing file. It is not possible to
261 overwrite a directory with a file.
262
263
264 rename
265
266
267 Renames the newly created file. Mtools prompts for the new
268 filename
269
270
271 autorename
272
273
274 Renames the newly created file. Mtools chooses a name by
275 itself, without prompting
276
277
278 skip
279
280
281 Gives up on this file, and moves on to the next (if
282 any)
283
284
285 To chose one of these actions, type its first letter at the
286 prompt. If you use a lower case letter, the action only
287 applies for this file only, if you use an upper case letter,
288 the action applies to all files, and you won't be prompted
289 again.
290
291
292 You may also chose actions (for all files) on the command
293 line, when invoking mtools:
294
295
296 -D o
297
298
299 Overwrites primary names by default.
300
301
302 -D O
303
304
305 Overwrites secondary names by default.
306
307
308 -D r
309
310
311 Renames primary name by default.
312
313
314 -D R
315
316
317 Renames secondary name by default.
318
319
320 -D a
321
322
323 Autorenames primary name by default.
324
325
326 -D A
327
328
329 Autorenames secondary name by default.
330
331
332 -D s
333
334
335 Skip primary name by default.
336
337
338 -D S
339
340
341 Skip secondary name by default.
342
343
344 -D m
345
346
347 Ask user what to do with primary name.
348
349
350 -D M
351
352
353 Ask user what to do with secondary name.
354
355
356 Note that for command line switches lower/upper
357 differentiates between primary/secondary name whereas for
358 interactive choices, lower/upper differentiates between
359 just-this-time/always.
360
361
362 The primary name is the name as displayed in Windows 95 or
363 Windows NT: i.e. the long name if it exists, and the short
364 name otherwise. The secondary name is the
365
366
367 By default, the user is prompted if the primary name
368 clashes, and the secondary name is autorenamed.
369
370
371 If a name clash occurs in a Unix directory, mtools only asks
372 whether to overwrite the file, or to skip it.
373
374
375 __Case sensitivity of the VFAT filesystem__
376
377
378 The VFAT filesystem is able to remember the case of the
379 filenames. However, filenames which differ only in case are
380 not allowed to coexist in the same directory. For example if
381 you store a file called !LongFileName on a VFAT filesystem,
382 mdir shows this file as !LongFileName, and not as
383 Longfilename. However, if you then try to add !LongFilename
384 to the same directory, it is refused, because case is
385 ignored for clash checks.
386
387
388 The VFAT filesystem allows to store the case of a filename
389 in the attribute byte, if all letters of the filename are
390 the same case, and if all letters of the extension are the
391 same case too. Mtools uses this information when displaying
392 the files, and also to generate the Unix filename when
393 mcopying to a Unix directory. This may have unexpected
394 results when applied to files written using an pre-7.0
395 version of DOS: Indeed, the old style filenames map to all
396 upper case. This is different from the behavior of the old
397 version of mtools which used to generate lower case Unix
398 filenames.
399
400
401 __high capacity formats__
402
403
404 Mtools supports a number of formats which allow to store
405 more data on disk as usual. Due to different operating
406 system abilities, these formats are not supported on all
407 OS'es. Mtools recognizes these formats transparently where
408 supported.
409
410
411 In order to format these disks, you need to use an operating
412 system specific tool. For Linux, suitable floppy tools can
413 be found in the fdutils package at the following
414 locations~:
415
416
417 ftp://www.tux.org/pub/knaff/fdutils/.
418 ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/fdutils-*
419
420
421 See the manpages included in that package for further
422 detail: Use superformat to format all formats
423 except XDF, and use xdfcopy to format
424 XDF.
425
426
427 __More sectors__
428
429
430 The oldest method of fitting more data on a disk is to use
431 more sectors and more cylinders. Although the standard
432 format uses 80 cylinders and 18 sectors (on a 3 1/2 high
433 density disk), it is possible to use up to 83 cylinders (on
434 most drives) and up to 21 sectors. This method allows to
435 store up to 1743K on a 3 1/2 HD disk. However, 21 sector
436 disks are twice as slow as the standard 18 sector disks
437 because the sectors are packed so close together that we
438 need to interleave them. This problem doesn't exist for 20
439 sector formats.
440
441
442 These formats are supported by numerous DOS shareware
443 utilities such as fdformat and vgacopy. In
444 his infinite hybris, Bill Gate$ believed that he invented
445 this, and called it `DMF disks', or `Windows
446 formatted disks'. But in reality, it has already
447 existed years before! Mtools supports these formats on
448 Linux, on !SunOs and on the DELL Unix PC.
449
450
451 __Bigger sectors__
452
453
454 By using bigger sectors it is possible to go beyond the
455 capacity which can be obtained by the standard 512-byte
456 sectors. This is because of the sector header. The sector
457 header has the same size, regardless of how many data bytes
458 are in the sector. Thus, we save some space by using
459 ''fewer'', but bigger sectors. For example, 1 sector of
460 4K only takes up header space once, whereas 8 sectors of 512
461 bytes have also 8 headers, for the same amount of useful
462 data.
463
464
465 This method allows to store up to 1992K on a 3 1/2 HD
466 disk.
467
468
469 Mtools supports these formats only on Linux.
470
471
472 __2m__
473
474
475 The 2m format was originally invented by Ciriaco Garcia de
476 Celis. It also uses bigger sectors than usual in order to
477 fit more data on the disk. However, it uses the standard
478 format (18 sectors of 512 bytes each) on the first cylinder,
479 in order to make these disks easyer to handle by DOS. Indeed
480 this method allows to have a standard sized bootsector,
481 which contains a description of how the rest of the disk
482 should be read.
483
484
485 However, the drawback of this is that the first cylinder can
486 hold less data than the others. Unfortunately, DOS can only
487 handle disks where each track contains the same amount of
488 data. Thus 2m hides the fact that the first track contains
489 less data by using a ''shadow FAT''. (Usually, DOS stores
490 the FAT in two identical copies, for additional safety. XDF
491 stores only one copy, and it tells DOS that it stores two.
492 Thus the same that would be taken up by the second FAT copy
493 is saved.) This also means that your should __never use a
494 2m disk to store anything else than a DOS
495 fs__.
496
497
498 Mtools supports these format only on Linux.
499
500
501 __XDF__
502
503
504 XDF is a high capacity format used by OS/2. It can hold 1840
505 K per disk. That's lower than the best 2m formats, but its
506 main advantage is that it is fast: 600 milliseconds per
507 track. That's faster than the 21 sector format, and almost
508 as fast as the standard 18 sector format. In order to access
509 these disks, make sure mtools has been compiled with XDF
510 support, and set the use_xdf variable for the drive
511 in the configuration file. See section Compiling mtools, and
512 `misc variables', for details on how to do this. Fast XDF
513 access is only available for Linux kernels which are more
514 recent than 1.1.34.
515
516
517 Mtools supports this format only on Linux.
518
519
520 __Caution / Attention distributors__: If mtools is
521 compiled on a Linux kernel more recent than 1.3.34, it won't
522 run on an older kernel. However, if it has been compiled on
523 an older kernel, it still runs on a newer kernel, except
524 that XDF access is slower. It is recommended that
525 distribution authors only include mtools binaries compiled
526 on kernels older than 1.3.34 until 2.0 comes out. When 2.0
527 will be out, mtools binaries compiled on newer kernels may
528 (and should) be distributed. Mtools binaries compiled on
529 kernels older than 1.3.34 won't run on any 2.1 kernel or
530 later.
531
532
533 __Exit codes__
534
535
536 All the Mtools commands return 0 on success, 1 on utter
537 failure, or 2 on partial failure. All the Mtools commands
538 perform a few sanity checks before going ahead, to make sure
539 that the disk is indeed an MS-DOS disk (as opposed to, say
540 an ext2 or minix disk). These checks may reject partially
541 corrupted disks, which might otherwise still be readable. To
542 avoid these checks, set the MTOOLS_SKIP_CHECK environmental
543 variable or the corresponding configuration file variable
544 (see section global variables)
545
546
547 __Bugs__
548
549
550 An unfortunate side effect of not guessing the proper device
551 (when multiple disk capacities are supported) is an
552 occasional error message from the device driver. These can
553 be safely ignored.
554
555
556 The fat checking code chokes on 1.72 Mb disks mformatted
557 with pre-2.0.7 mtools. Set the environmental variable
558 MTOOLS_FAT_COMPATIBILITY (or the corresponding configuration
559 file variable, `global variables') to bypass the fat
560 checking.
561 !!See also
562
563
564 floppyd_installtest mattrib mbadblocks mcd mcopy mdel
565 mdeltree mdir mdu mformat minfo mkmanifest mlabel mmd mmount
566 mmove mrd mren mtoolstest mtype
567 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.