*BSD News Article 2386


Return to BSD News archive

Path: sserve!manuel!munnari.oz.au!uunet!charon.amdahl.com!amdahl!JUTS!griffin!gab10
From: gab10@griffincd.amdahl.com (Gary A Browning)
Newsgroups: comp.unix.bsd
Subject: Re: using mtools to access dos partitions
Message-ID: <2eLv02wc1bJx01@JUTS.ccc.amdahl.com>
Date: 24 Jul 92 08:07:38 GMT
References: <BrtHvn.Is6@usenet.ucs.indiana.edu> <1373@sousa.ltn.dec.com>
Sender: netnews@ccc.amdahl.com
Organization: Amdahl Corporation, Sunnyvale CA
Lines: 43


In article <1373@sousa.ltn.dec.com> you write:
>mitchemt@silver.ucs.indiana.edu (Terrence Mitchem) writes:
>: 
>: 	Can anyone tell me how to set up the devices.c file that comes with
>: mtools in order to access dos partitions on  hard drive? Which
devices in /dev
>: correspond to the partitions on the disk?  Does it make any
difference if Im
>: using a scsi controller (adaptec 1542b)?  All help is appreciated.
>
>With the new "wd" driver that uses the "a5" partition for the BSD
artition...
>none of the devices in "/dev" correspond to the DOS partition.[ 
>HOWEVER:  the escape hatch is via /dev/wd0d.  The "d" partitio covers
the
>*WHOLE* hard disk, whereas the "c" partition covers only the *whole*
>386bsd area.
>
>To build a devices.c file that lets you access the DOS partition, you
>need to know the byte offset of the DOS partition from the start of
>the hard disk.  You would then add an entry to the devices[] array
>as follows:
[ furthur explanation deleted ]

Can't you just create a new device to access the DOS partitions without
recompiling the kernel?  The /etc/disktab file probably does not match 
your actual disk label but this can be gotten using the 'disklabel'
program.  It looks like the locations of the partitions are specified in
sectors from the *beginning of the hard disk*, not the beginning of the
386BSD partition.  You should be able to update the /etc/disktab
from the output of 'disklabel', add the new entry describing the DOS
partition location (multiply it out from the cylinder info supplied from
MS-DOG's 'fdisk' program), rebuild the disk label using 'disklabel', and
create another device, say /dev/as0g, using 'mknod' (the meaning of the 
minor device number is at the beginning of the file 'as.c').

This is what I was going to try.  Am I missing something?

-- 
Gary Browning        | Exhilaration is that feeling you get just after a
		     | great idea hits you, and just before you realize
                     | what is wrong with it.