drive z: file="/dev/sdb" partition=1
drive z: file="/dev/sdb" partition=4
$ 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
First, if you use a SuSE or Redhat distribution, there is no need to
compile mtools, a premade RPM
file is available. Download it, and install it with rpm -U mtools-4.0.18-1.i586.rpm
.
If you use another distribution, or if you want to use a version of mtools that's more recent than the RPM, 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.18, 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.
> gzip -dc $HOME/mtools-4.0.18.tar.gz | tar xfv -
mtools-4.0.18/
mtools-4.0.18/INSTALL
mtools-4.0.18/buffer.c
mtools-4.0.18/Release.notes
...
mtools-4.0.18/llong.c
mtools-4.0.18/llong.h
mtools-4.0.18/floppyd.c
> cd mtools-4.0.18
> gzip -dc $HOME/mtools-4.0.18-20071226.diff.gz | patch -p1 -s
> ./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
> 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
> su
Password:
# 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:
> mv mtools-4.0.18.tar mtools-4.0.18.tar.gz
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