-
Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
-
Chapter 28. Emulators, Tools, and Window Clients
- Emulators
- The mtools Package
- Windowing Network Clients
- Summary
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
The mtools Package
The mtools package, originally by Emmet P. Gray and now maintained by Alain Knaff and David Niemi, is a public-domain set of programs you can use in just about any operation on MS-DOS floppies. The mtools package can help you when working with the DOS or Windows operating system while running Linux, and facilitate the transfer of information and manipulation of removable media for those operating systems.
These commands are useful because you don't need to reboot to DOS or Windows, run an emulator, or mount the floppy in order to read, write, or make changes to the floppy's contents. Table 28.3 lists the tools included in the package.
Table 28.3. mtools Package Contents
| Program Name | Function |
| mattrib | Changes file attributes |
| mbadblocks | Floppy testing program |
| mcd | Changes directory command |
| mcheck | Checks a floppy |
| mcopy | Copies files to and from floppy disk |
| mdel | Deletes files on disk |
| mdeltree | Recursively deletes files and directories |
| mdir | Lists contents of a floppy |
| mformat | Formats a floppy |
| minfo | Categorizes, prints floppy characteristics |
| mkmanifest | Restores Linux filenames from floppy |
| mlabel | Labels a floppy |
| mmd | Creates subdirectory |
| mmount | Mounts a floppy |
| mmove | mv command for floppy files and directories |
| mpartition | Makes a DOS filesystem as a partition |
| mrd | Deletes directories |
| mren | Renames a file |
| mtoolstest | Tests mtools package installation |
| mtype | Types (lists) a file |
| mzip | ZIP/JAZ drive utility |
The most often used will be the mformat, mdir, mcopy, and mdel commands. The mformat command formats nearly any type of floppy device. One of this software package's nice features is that you don't have to remember the specific names of floppy devices, such as /dev/fd0, and can use the (possibly) familiar A or B drive designators. This is possible because of mtool's use of the configuration file, /etc/mtools.conf.
Entries for different disk devices are listed in the file. You can edit the file (as root) to configure mtools for your system without having to rebuild the software. (If you need the source, however, you can readily find a copy on your favorite Linux site, or at ftp://ftp.tux.org/pub/knaff/mtools, along with numerous add-ons and utilities.) If you examine the /etc/mtools.conf file, you'll see entries for different devices and configurations for other operating systems. For example, the floppy device entries look like this:
# Linux floppy drives drive a: file="/dev/fd0" exclusive 1.44m mformat_only drive b: file="/dev/fd1" exclusive 1.44m mformat only
These entries allow you to easily format a floppy in drive A without mounting the disk:
# mformat a:
After the mformat command has finished, you can copy files to and from the disk with the mcopy command. Here is an example:
# mcopy *.txt a:
This copies all files ending in .txt to your disk. To copy files from your disk, reverse the arguments (in DOS form) to the mcopy command:
# mcopy a:*.txt
This copies all files ending in .txt to the current directory, or to whatever directory you specify. To see what is on the disk, use the mdir command. Here is an example:
# mdir a
Volume in drive A has no label
Volume Serial Number is 4917-9EDD
Directory for A:/
launch gif 62835 04-09-1999 13:43 launch.gif
vmware gif 10703 04-09-1999 13:44 vmware.gif
vnc gif 21487 04-09-1999 13:44 vnc.gif
3 files 95 025 bytes
1 362 432 bytes free
You can use the mlabel command to label the disk:
# mlabel a: Volume has no label Enter the new volume label : LINUX
You can also use special shell command-line quoting to label the disk from the command line:
# mlabel a:'DOS DISK'
This is a handy way to use spaces in a disk's label. If you want to delete files on your disk, use the mdel command:
# mdel a:*.txt
This deletes all files ending in .txt on the disk in the A drive. You can also mount your disk. For details, see the mmount command manual page, along with the mount command manual page.
Windowing Network Clients | Next Section