Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Feb 1997 21:24:30 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-hackers@FreeBSD.ORG, sja@tekla.fi
Subject:   Re: Error Message (mounting a DOS partition)
Message-ID:  <199702011024.VAA17625@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I also have a DOS partition I can't mount (not that I really care...)
>There seems to be some sort of offset thingie going on that FreeBSD
>doesn't know about.

Actually, FreeBSD knows a lot about it.

>I have three slices:
>/dev/wd0s1 is DOS C: and can be mounted from FreeBSD.
>/dev/wd0s2 is FreeBSD.
>/dev/wd0s3 is DOS D: and can NOT be mounted from FreeBSD.
>
>/dev/wd0s3 (aka D:) has NULs at the beginning where mountmsdosfs()
>expects a boot sector.  However, there seems to be a DOS fs at an
>offset of 0x7e00 bytes (go figure) from the beginning:
>
>hexdump -C /dev/wd0s3 | head -12

This is a good way to check that the slice contains what you think it
does.

>00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
>*
>000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 01  |................|
>000001c0  c1 9a 06 3f ff fd 3f 00  00 00 c1 26 06 00 00 00  |...?..?....&....|
                             ^^^^^^^^^^^^ ^^^^^^^^^^^
                             offset of 1st  size of
                             slice in 1st   slice
                             logical drive  (403137 decimal)
>000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
>*
>00007e00  eb 3c 90 4d 53 44 4f 53  35 2e 30 00 02 08 01 00  |.<.MSDOS5.0.....|
 ^^^^^^^^ (offset 0x3f) * (sector size 0x200) = 0x7e00
>00007e10  02 00 02 00 00 f8 c5 00  3f 00 40 00 3f 00 00 00  |........?.@.?...|
>00007e20  c1 26 06 00 80 00 29 cf  1e 40 11 44 20 20 20 20  |.&....)..@.D    |

>Here is fdisk output:
>
>******* Working on device /dev/rwd0 *******
>parameters extracted from in-core disklabel are:
>cylinders=1023 heads=64 sectors/track=63 (4032 blks/cyl)
>...
>The data for partition 2 is:
>sysid 5,(Extended DOS)
>    start 3717504, size 403200 (196 Meg), flag 0
                         ^^^^^^ used up by 1 logical drive of size 403200
                                containing 1 slice of size 403200-63 at
                                relative offset 63
>        beg: cyl 922/ sector 1/ head 0;
>        end: cyl 1021/ sector 63/ head 63

wd0s3 is an extended partition.  It may contain almost any number of
logical drives, of which DOS officially supports up to 23 (D:-Z:)
provided there is only one DOS drive, and FreeBSD supports 26
(wd0s5-wd0s30) independently of other drives.

>dev/wd0s3 is DOS D: and can NOT be mounted from FreeBSD.

/dev/wd0s5 is DOS D: and CAN be mounted from FreeBSD.

DOS drive numbering is very illogical and isn't understood by FreeBSD.
E.g., if you add another drive and put a primary DOS partition partition
on it, then IIRC it will become D: and the old D: will become E:.
FreeBSD attempts to support multiple extended partitions and multiple
logical drives at every level, but you shouldn't use this.  It isn't
standard and makes the numbering more confusing.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702011024.VAA17625>