Subject: Re: netbsd/dos on same disk
To: Brian Leonard <paranoid@texas.net>
From: None <Mark_Weaver@brown.edu>
List: port-i386
Date: 08/16/1995 17:31:36
> What's the correct way to label a disk so netbsd can mount dos partitions?
> Everything I've tried has either munched the partition table, or given me
> "device not configured" when I mount the dos partition (yes, msdosfs is in
> the kernel).

The following instructions assume that you already have at least one
NetBSD partition on the same disk as the dos partition.

First use "fdisk /dev/r?d?d" to read the MS-DOS partition table for
the disk.

Here's the important part of `fdisk /dev/rwd1d`, my second IDE disk:

----------------------------------------
The data for partition 0 is:
sysid 6 (Primary 'big' DOS (> 32MB))
    start 63, size 204561 (99 MB), flag 80
	beg: cylinder    0, head   1, sector  1
	end: cylinder  202, head  15, sector 63
----------------------------------------

The numbers of importance are "start 63, size 204561".

Now, use "disklabel -e ?d?", eg. "disklabel -e wd1" for me.  Add a
partition line like the last one shown here:

----------------------------------------
8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:   819504   236880    4.2BSD     1024  8192    16 	# (Cyl.  235 - 1047)
  b:    32256   204624    4.2BSD     1024  8192    16 	# (Cyl.  203 - 234)
  c:   851760   204624    unused        0     0       	# (Cyl.  203 - 1047)
  d:  1056384        0    unused        0     0       	# (Cyl.    0 - 1047)
  h:   204561       63     MSDOS                    	# (Cyl.    0*- 202*)
----------------------------------------

Use the "start" and "size" values from fdisk for the "offset" and
"size" parameters in the partition table, respectively.  Leave off the
trailing comment, disklabel will add it for you.

Here's an /etc/fstab entry:
/dev/wd1h	/dos		msdos ro 1 0

The "ro" means read-only, since I don't trust the msdos code.  It's
trashed my dos partition a few times.  Change it to "rw" if desired.

You might have to reboot to have the disklabel take effect, I'm not
sure.

Personally, I usually use mtools instead of mounting, because I find
it more reliable, although lots of bugs have been fixed in NetBSD's
msdosfs since I last used it.

	Mark
--------------------------------------------------------------------
Email: Mark_Weaver@brown.edu           | Brown University
PGP Key: finger mhw@cs.brown.edu       | Dept of Computer Science