Subject: Accessing my MS-DOS partition... help!!!
To: None <netbsd-help@NetBSD.ORG>
From: Paul Hollow (3Y0) <ph-a@ugrad.cs.york.ac.uk>
List: netbsd-help
Date: 05/14/1996 17:21:23
Hi y'all...

I need help accessing my MS-DOS partition from NetBSD1.1/i386.  I have followed
the instructions in the NetBSD FAQ (a copy of which is included below...) to
create an extra partition, but whenever I try to mount the new partition, i
get a "device not configured" error.

Disklabel creates the extra partition, but resets whatever name i give it
("msdos") to "unused".

Does anyone have any ideas?  Any help appreciated...

Cheers

Paul Hollow (ph-a@ugrad.cs.york.ac.uk)

The FAQ says to do the following (the only difference on my machine is that i
wan to mount /dev/wd0f as my MS-DOS partition)...

        If you're whole disk is dedicated to Unix, then that's all you
        need to know.  But if you're sharing your disk with DOS, then
        there are a few magical things happening.

        DOS has it's own partitioning scheme.  The way NetBSD co-exists
        with this is to fit all of the Unix partitions into one DOS
        partition.  So partitions a-h all fit inside one DOS partition,
        which has a partition type of 165 (each MS-DOS partition has a
        "partition type" associated with it.  The BSD partition type is
        165).  In this setup, partition "c" refers to the entire BSD
        partition.  But in this scheme, partition "d" refers to the ENTIRE
        disk, MS-DOS partitions and all.

        So, if you want to access your MS-DOS partition from NetBSD, first
        you'll have to create a partition that points to the MS-DOS
        partition.  You'll want to run the command:

        disklabel -e -r /dev/r??0d      (fill in with your disk type).

        You'll get popped into an editor with all the disklabel stuff in
        it.  Go down to the bottom.  You should see something like:

        6 partitions:
        #        size   offset    fstype   [fsize bsize   cpg]
        a:    30720   409600    4.2BSD     1024  8192    16   # (Cyl...
        b:   129024   440320      swap                        # (Cyl...
        c:  1617920   409600    unused        0     0         # (Cyl...
        d:  2029568        0    unused        0     0         # (Cyl...
        e:    61440   569344    4.2BSD     1024  8192    16   # (Cyl...
        f:  1396736   630784    4.2BSD     1024  8192    16   # (Cyl...

        (or whatever it appropriate for your disk).  Note that partition
        "a" starts on cylinder 200.  That's where my BSD partition starts
        on my disk.  Also note that partition "c" starts at 200 as well
        and goes to the end of the disk.  You'll also note that partition
        "d" goes from sector 0 all the way to the end of the disk.

        Add a new line that looks something like:

        g:   409568       32    MS-DOS                        # (Cyl.    0*-
199*)

        (The comment on the end isn't necessary.  Only the partition
        letter, size, offset, and parition type are needed.  You can
        put unused in instead of MS-DOS if you want).

        *NOTE* Be sure to change the line that says "6 partitions" to the
        new number of paritions that you have!!!  Otherwise you'll get an
        obscure error.  In my case I'd change that line to be "7 partitions".
        If you aren't sure what your MS-DOS partition size and offsets are,
        you can use the NetBSD fdisk to find them out.  Don't forget that
        there's a maximum of 8 partitions.

        Once you do that and you have MSDOSFS configured into your kernel,
        you can just do something like "mount -t msdos /dev/sd0g /msdos".
        Or you can put a line like this in your fstab:

        /dev/sd0g /msdos msdos rw 0 0


-- 

  _   _ ___  ph-a @ minster.york.ac.uk    C=  /// There's no such thing
 I I_I I _ \ hollow @ bcs.org.uk       A1200 ///  as gravity...
 I  _  I  _/ Dept. of Computer Science  \\\/// ...the Earth just sucks.
 I_I I_I_I   University of York, UK      \XX/ http://www.york.ac.uk/~ph100