Mtools frequently asked questions
- Is there a way to configure mtools so that it takes both Mac Zip disks (partition 1) and PC Zip disks (partition 4) without changing the config file between each?
- Is it possible to partition and format Zip 250 disks using mtools?
- I'm new to Linux (Unix), how do I compile mtools?
- Mtools doesn't read CD-Roms!
- Is there a way to configure mtools so that it takes both Mac Zip disks (partition 1) and PC Zip disks (partition 4) without changing the config file between each?
Yes, you may enter both configurations at once into your configuration file. That way, mtools checks both, and uses the first that matches:
drive z: file="/dev/sdb" partition=1 drive z: file="/dev/sdb" partition=4
- Is it possible to partition and format Zip 250 disks using mtools?
Sure. However, by default the builtin definition for the zip drive (z:) has the parameters for the 100 Meg variant. If you want to format a 250 MB disk, you have to supply the parameters explicitly:
$ mpartition -c -t 239 -h 64 -s 32 -b 32 Z: $ mformat -t 239 -h 64 -s 32 -H 32 z:
You can also enter the parameters into your
/etc/mtools.conf
file:drive z: file="/dev/sda" scsi privileged cylinders=239 heads=64 sectors=32 hidden=32 mformat_only
- I'm new to Linux (Unix), how do I compile mtools?
First, if you use a Debian distribution, there is no need to compile mtools, a premade deb package is available. Download it, and install it with
dpkg -i mtools_4.0.45_amd64.deb
.If you use another distribution, or if you want to use a version of mtools that's more recent than the debian package, proceed as follows:
Let's assume that you have downloaded the mtools tar file, and any patch to your homedirectory, before you start. This example uses mtools version 4.0.45, substitute the appropriate version if you use something else. In the examples below, what you should type is shown in bold face, whereas the computer's output and prompts are shown in a italic font. Long output is abridged in the examples.
- Unpack mtools:
$ gzip -dc $HOME/mtools-4.0.45.tar.gz | tar xfv - mtools-4.0.45/ mtools-4.0.45/INSTALL mtools-4.0.45/buffer.c mtools-4.0.45/Release.notes ... mtools-4.0.45/llong.c mtools-4.0.45/llong.h mtools-4.0.45/floppyd.c
- Go into the mtools directory:
$ cd mtools-4.0.45
- Apply the patch, if you have any:
$ gzip -dc $HOME/mtools-4.0.45-20071226.diff.gz | patch -p1 -s
- Configure it:
$ ./configure creating cache ./config.cache checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no ... checking for main in -lnsl... no updating cache ./config.cache creating ./config.status creating Makefile creating config.h
- Compile it:
$ make gcc -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -DCPU_i686 -DVENDOR_pc \ -DOS_linux -g -O2 -fno-strength-reduce -Wall -I. -I. -c buffer.c gcc -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -DCPU_i686 -DVENDOR_pc \ -DOS_linux -g -O2 -fno-strength-reduce -Wall -I. -I. -c codepage.c gcc -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -DCPU_i686 -DVENDOR_pc \ -DOS_linux -g -O2 -fno-strength-reduce -Wall -I. -I. -c codepages.c gcc -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -DCPU_i686 -DVENDOR_pc \ -DOS_linux -g -O2 -fno-strength-reduce -Wall -I. -I. -c config.c ... gcc -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -DCPU_i686 -DVENDOR_pc \ -DOS_linux -g -O2 -fno-strength-reduce -Wall -I. -I. -c floppyd.c gcc -L/usr/X11R6/lib floppyd.o -o floppyd -lX11 -lXau gcc -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -DCPU_i686 -DVENDOR_pc \ -DOS_linux -g -O2 -fno-strength-reduce -Wall -I. -I. -c floppyd_installtest.c gcc -L/usr/X11R6/lib floppyd_installtest.o misc.o expand.o privileges.o -o \ floppyd_installtest -lX11 -lXau
- Become root:
$ su Password:
- Install mtools:
# make install ./mkinstalldirs /usr/local/bin /usr/bin/install -c mtools /usr/local/bin/mtools ./mkinstalldirs /usr/local/bin /usr/bin/install -c floppyd /usr/local/bin/floppyd ./mkinstalldirs /usr/local/bin /usr/bin/install -c floppyd_installtest /usr/local/bin/floppyd_installtest /usr/local/man/man1/floppyd.1 /usr/local/man/man1/mattrib.1 ... Making info file `mtools.info' from `mtools.texi'. ./mkinstalldirs /usr/local/info if test -f mtools.info; then \ for i in mtools.info*; do \ /usr/bin/install -c -m 644 $i /usr/local/info/$i; \ done; \ else \ for i in ./mtools.info*; do \ /usr/bin/install -c -m 644 $i /usr/local/info/`echo $i | sed 's|^./||'`; \ done; \ fi
Notes:
- Some web browsers automatically uncompress the files when downloading. In that case, you can skip the gzip -dc bit, and simply use tar xfv $HOME/mtools-4.0.45.tar to unpack mtools, and patch -p1 -s < $HOME/mtools-4.0.45-20071226.diff to apply a patch.
- Other web browser strip the .gz suffix, but without
actually uncompressing the files. In that case, rename them back to
their appropriate names before unpacking and compiling:
$ mv mtools-4.0.45.tar mtools-4.0.45.tar.gz
- Unpack mtools:
- Mtools doesn't read CD-Roms!
This is to be expected. There are several ways in which operating systems can organize their file data on a raw device. These are called filesystem types. MSDOS for instance uses the FAT filesystem. Linux usually uses ext2. Macintoshes use HFS. NT usually uses NTFS. And CD-Roms usually use ISO9660.
Mtools is intended to read FAT (native MS-Dos) filesystem, and hence cannot read CD-Roms.
However, you can mount the CD-Rom natively using the following command:
$ mount -t iso9660 /dev/cdrom /cdrom