Linux HOWTOs

About | Home | Search

HOWTO: mtools
Description: A collection of utilities to access MS-DOS disks from Unix without mounting
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# mtools 3.9.10
# =============
# Slackware has the 'floppy' package which includes mtools and fdutils.
# If you follow this howto and remove 'floppy', you should continue to the
# fdutils howto to re-install it.

# Slackware 8.1, 9.0, 9.1, 10.0, 10.1, and 10.2's 'floppy' packages include
# mtools 3.9.8

# Prerequisites:
# grep
# texinfo
# XFree86 or

test -f installed/mtools-3.9.10.tar.gz && mv installed/mtools-3.9.10.tar.gz .
test ! -f mtools-3.9.10.tar.gz &&

# Verify tarball w/ md5sum:
echo "19bc1f06e9c5865b8ad20b1ddd976f5f  mtools-3.9.10.tar.gz" | md5sum -c

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "mtools-*" -exec rm -r {} \;
tar xzvf ~/mtools-3.9.10.tar.gz
cd mtools-3.9.10
test $UID = 0 && chown -R root:root .
chmod -R u+w .

# Apply this patch to 3.9.10 from the author:
wget -nc &&
 zcat mtools-3.9.10-20051011.diff.gz | patch -p1

./configure --prefix=/usr --sysconfdir=/etc

# Become root to backup files and to install it

# Back up mtools configuration (because 'removepkg floppy' will remove it):
test -f /etc/mtools.conf &&
 ( mkdir -p -m 0700 ~/backup ; cp /etc/mtools.conf ~/backup/ )

test -x /sbin/removepkg && /sbin/removepkg floppy
make install
chown -R $USER .

# Either restore your existing mtools.conf from ~/backup/ (if you have one)
# or copy over the sample mtools.conf  You must open this up and change a few
# things before it'll be used (comment out line 3, etc.):
test ! -f /etc/mtools.conf && cp mtools.conf /etc/

# Become yourself again

mkdir -p -m 0700 installed
rm -f installed/mtools-*.tar.* installed/mtools-*.diff.gz
mv mtools-3.9.10.tar.gz installed/

# If you ever want to uninstall mtools, this should do it:
test -d src/mtools-* && ( cd src/mtools-* ; make uninstall )
( cd /usr/bin ; rm -f lz mcheck mcomp mxtar tgz uz )
( cd /usr/man/man1 ; rm -f floppyd.1 floppyd_installtest.1 mattrib.1 \
 mbadblocks.1 mcat.1 mcd.1 mclasserase.1 mcopy.1 mdel.1 mdeltree.1 mdir.1 \
 mdu.1 mformat.1 minfo.1 mkmanifest.1 mlabel.1 mmd.1 mmount.1 mmove.1 \
 mpartition.1 mrd.1 mren.1 mshowfat.1 mtoolstest.1 mtools.1 mtype.1 mzip.1 )
rm -f /etc/mtools.conf /usr/info/ /usr/man/man5/mtools.5
find ~/src -maxdepth 1 -type d -name "mtools-*" -exec rm -r {} \;
rm -f ~/installed/mtools-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>