Return to BSD News archive
Received: by minnie.vk1xwt.ampr.org with NNTP
id AA7545 ; Fri, 22 Jan 93 16:00:44 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!uunet!zaphod.mps.ohio-state.edu!rpi!uwm.edu!miller.cs.uwm.edu!jimj
From: jimj@miller.cs.uwm.edu (James Jegers)
Newsgroups: comp.unix.bsd
Subject: MS-DOS mounting DOCS
Date: 22 Jan 1993 00:05:28 GMT
Organization: University of Wisconsin - Milwaukee
Lines: 126
Distribution: world
Message-ID: <1jndo8INNma9@uwm.edu>
NNTP-Posting-Host: 129.89.9.13
Hope you enjoy the DOC..
386BSD now support DOS filesystems. There are two
ways in which you may read a DOS filesystem.
1. Via the mtools commands which simulate the DOS commands
such as mdir, mcopy, mcd, mmkdir, etc.
2. Or you can mount the DOS filesystem just like a UNIX
filesystem.
-------------------------------------------------------------------------
Be careful with the PCFS part in your kernel. It's not the
smartest of things it doesn't do that much error checking.
For instance:
If I try to mount certain ISO CD's as PCFS, my machine locks
up shortly after.
If I try to mount a partion as PCFS which isn't MSDOS, (or is
random sectors on the disks) the magic nicely panics and reboots.
-------------------------------------------------------------------------
To read and write DOS floppies, You must,
1. Make the floppy minor devices in /dev by running the MAKEDEV script.
cd /dev; sh MAKEDEV fd0 fd1
2. If you wants to use the mtools,
Then compile the mtools package which came with 386bsd. The
devices.c file should already be setup for use with 386bsd.
Insert the floppy and run mdir a: or mdir b:
to get a directory..
Use the other m?? commands for the other functions.
3. If you wish to mount the DOS floppy,
Install the PCFS filestems type into your kernel and
recompile your kernel via the instructions given with
PCFS.
mount the DOS floppy to a directory,
mount -t pcfs /dev/fd0d /mnt
fd0d for the floppy #1, fd1d for floppy #2.
To read and write to you DOS partition on your Hard Drive, you must,
1. Set up a DOS partition on your hard drive following the instruction
from the 386BSD installation manual.
2. Get the fdisk command(ref.tfs.com, and elsewhere) and run it to
find the starting sector/size of your DOS partition,
fdisk /dev/rsd0d or fdisk /dev/rwd0d
The data for partition 0 is:
sysid 6,(Primary 'big' DOS (> 32MB))
start 32, size 819168 (399 Meg), flag 80
beg: cyl 0/ sector 1/ head 1;
end: cyl 399/ sector 32/ head 63
The data for partition 3 is:
sysid 165,(386BSD)
start 819200, size 1259520 (615 Meg), flag 0
beg: cyl 400/ sector 1/ head 0;
end: cyl 1014/ sector 32/ head 63
Looking at above the DOS partition starts at sector 32 and
is 819168 sectors big.
3. Edit your disklabel to have a partition which is the same as
your dos partition.
disklabel -e /dev/rsd0d
Make the partition name E or F, etc.
WARNING: Do not make the DOS partition the C or D partition unless
the DOS partition covers the entire drive! Partition C is
the whole UNIX partition and partition D is the whole drive.
c: 1259520 819200 unused 0 0 # (Cyl. 642*- 1630*)
d: 2113950 0 unused 0 0 # (Cyl. 0 - 1657)
f: 819168 32 MSDOS # (Cyl. 0*- 642*)
4. If you are using mtools,
modify the devices.c file to include a drive letter which uses
this new partition.
{'C', "/dev/rsd0f", 0L, 16, 0, (int (*) ()) 0, 0, 0, 0},
Someone did post a patch to make mtools automatically find the
DOS partition, but I couldn't get it to work, so I do it this way.
You can then run the mtools commands to read/write from the hard
drive. ie.. mdir c: mcopy c:autoexec.bat .
5. If you wish to mount the filesystem under UNIX.
Install the PCFS filesystem type into your kernel and
recompile your kernel via the instructions given with
PCFS.
There has also been some patches to PCFS to support
the DOS hard drive better.
mount the DOS hard drive partition just like the floppy,
mount -t pcfs /dev/sd0f /mnt
^^^^^^^^^ use the partition letter which you created
above.
------------------------------------------------------------------------------
I hope this helps. PS. I'm not responsible for anything that you do,
I just wrote this to try to help out.
______________________________________________________________
/\ University of Wisconsin -- Milwaukee \
\_| Computing Services Division Computer Science Department |
| jimj@csd4.csd.uwm.edu jimj@miller.cs.uwm.edu |
| jimj@convex.csd.uwm.edu |
| __________________________________________________________|___
\_/_____________________________________________________________/