How do I mount my existing DOS partition ?

How do I mount my existing DOS partition ?

Post by Thierry Herbelo » Mon, 25 Nov 2002 01:38:43



Hello,

I've got an oldish PC with Win98 and OpenBSD (3.1-Stable).

I wanted to mount the DOS partition under OpenBSD, in order to temporarily
store BSD files. I have tried some experiments (see later), and I've mounted
the DOS partition, but I still am unsure I will be able to boot from the
new partition setup (how will the BIOS boot from the OpenBSD, when the
partition table tells the BIOS OpenBSD starts on C/H/S 0/1/1 ?)

        My experiments follow :

I've been googling quite a lot, but I couldn't seem to see a clue :

the disk is detected as :
wd0: 16-sector PIO, LBA, 2014MB, 4092 cyl, 16 head, 63 sec, 4124736 sectors

the partition info is :
-----------------------------
test# fdisk wd0
Disk: wd0       geometry: 210/64/63 [846720 Sectors]
Offset: 0       Signature: 0xAA55
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
 0: 0B    0   1  1 -  812  63 63 [          63:     3277953 ] Win95 FAT-32
*1: A6  813   0  1 - 1022  63 63 [     3278016:      846720 ] OpenBSD
 2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 3: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
-----------------------------

NB : the "fdisk" geometry seems here false to me (it is only the part for
OpenBSD and not the full disk)

then, the disklabel info :

-----------------------------
test# disklabel wd0
# using MBR partition 1: type A6 off 3278016 (0x3204c0) size 846720
(0xceb80)
# /dev/rwd0c:
type: ESDI
disk: ad0s2
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 64
sectors/cylinder: 4032
cylinders: 210
total sectors: 846720
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:   204800  3278016    4.2BSD     2048 16384    16   # (Cyl.  813 - 863*)
  b:   143360  3482816      swap                        # (Cyl.  863*- 899*)
  c:   846720  3278016    unused        0     0         # (Cyl.  813 - 1022)
  e:    61440  3626176    4.2BSD     2048 16384    16   # (Cyl.  899*- 914*)
  f:   437120  3687616    4.2BSD     2048 16384    16   # (Cyl.  914*- 1022)
disklabel: partition a: offset past end of unit
disklabel: partition a: partition extends past end of unit
disklabel: partition b: offset past end of unit
disklabel: partition b: partition extends past end of unit
disklabel: partition c: offset past end of unit
disklabel: partition c: partition extends past end of unit
disklabel: partition e: offset past end of unit
disklabel: partition e: partition extends past end of unit
disklabel: partition f: offset past end of unit
disklabel: partition f: partition extends past end of unit
-----------------------------

I have tried to change the 'c' partition to cover the whole disk, and then
to declare an 'i' partition for Win, but disklabel only seems to shout at
me these meaningless error messages about partitions situated "past end the
unit"

I've tried to have a look at the interactive mode of fdisk, in order to try
and change the geometry of the disk, :

first get the correct full disk geometry

-----------------------------
test# fdisk -e wd0
Enter 'help' for information
fdisk: 1> disk
Disk: wd0       geometry: 210/64/63 [846720 Sectors]
Change disk geometry? [n] y
BIOS Cylinders [1 - 1024]: [210] 1023
BIOS Heads [1 - 256]: [64]
BIOS Sectors [1 - 63]: [63]
fdisk: 1> print
Disk: wd0       geometry: 1023/64/63 [4124736 Sectors]
Offset: 0       Signature: 0xAA55
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
 0: 0B    0   1  1 -  812  63 63 [          63:     3277953 ] Win95 FAT-32
*1: A6  813   0  1 - 1022  63 63 [     3278016:      846720 ] OpenBSD
 2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 3: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
-----------------------------

then change the second BIOS partition to cover the full disk (I fear this
creates aa erroneous BIOS partition table : two partitions begin at 0 !!!)

how will the BIOS be able to jump to the correct boot sector in each
partition ?

-----------------------------
fdisk:*1> edit 1
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
*1: A6    0   0  1 - 1022  63 63 [           0:     4124736 ] OpenBSD
Partition id ('0' to disable)  [0 - FF]: [A6] (? for help)
Do you wish to edit in CHS mode? [n] y
BIOS Starting cylinder [0 - 1022]: [0]
BIOS Starting head [0 - 63]: [0] 1
BIOS Starting sector [1 - 63]: [1] 1
BIOS Ending cylinder [0 - 1022]: [1022]
BIOS Ending head [0 - 63]: [63]
BIOS Ending sector [1 - 63]: [63]
fdisk:*1> print
Disk: wd0       geometry: 1023/64/63 [4124736 Sectors]
Offset: 0       Signature: 0xAA55
         Starting       Ending       LBA Info:
 #: id    C   H  S -    C   H  S [       start:      size   ]
------------------------------------------------------------------------
 0: 0B    0   1  1 -  812  63 63 [          63:     3277953 ] Win95 FAT-32
*1: A6    0   1  1 - 1022  63 63 [          63:     4124673 ] OpenBSD
 2: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
 3: 00    0   0  0 -    0   0  0 [           0:           0 ] unused
fdisk:*1> write
Writing MBR at offset 0.
fdisk: 1> quit
-----------------------------

now an incorrect BIOS partition has been written to the MBR !
anyway, it's now possible to see the DOS partition from BSD :

-----------------------------
test# disklabel -e wd0
# using MBR partition 1: type A6 off 63 (0x3f) size 4124673 (0x3ef001)
# /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: ST32122A
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 4092
total sectors: 4124736
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:  4124736        0    unused        0     0  # (Cyl.    0 - 4091)
  c:  4124736        0    unused        0     0  # (Cyl.    0 - 4091)
  i:  3277953       63     MSDOS                 # (Cyl.    0*- 3251)

-----------------------------
which I have changed to : (with values taken from the initial config)
-----------------------------
#        size   offset    fstype   [fsize bsize   cpg]
  a:   204800  3278016    4.2BSD 2048 16384 16   # (Cyl. 3252 - 3455*)
  b:   143360  3482816      swap                 # (Cyl. 3455*- 3597*)
  c:  4124736        0    unused      0     0    # (Cyl.    0 - 4091)
  e:    61440  3626176    4.2BSD 2048 16384 16   # (Cyl. 3597*- 3658*)
  f:   437120  3687616    4.2BSD 2048 16384 16   # (Cyl. 3658*- 4091)
  i:  3277953       63     MSDOS                 # (Cyl.    0*- 3251)
-----------------------------

and finally :
-----------------------------
test# mount_msdos /dev/wd0i /mnt
test# mount
/dev/wd0a on / type ffs (local)
/dev/wd0f on /usr type ffs (local)
/dev/wd0e on /var type ffs (local)
/dev/wd0i on /mnt type msdos (local)
-----------------------------

        and now, let's see if the machine will reboot !

        TfH

 
 
 

1. how do i mount an extended dos partition or a dos logical partition ?

i need to access/share data with an NT machine (not on a network)
i have 10G removable hard drives
i am trying to put a file system on it to allow access by both linux and
NT
linux won't mount an ntfs file system
the NT person put 4 primary (?) dos partitions on the disk
and if i run fdisk in linux it sees 4 FAT16 partitions
but it will only let me mount the first one

how do i mount the other 3 ?

is there some special way the disk needs to be formated by NT ?

thanks for any help,
dan

2. mounting win95 partition

3. What partition sysid is OK for extended DOS partition mount?

4. exceptions problems with Redhat5.0/gcc2.8.1

5. mishaps with co-existing OSs (Linux and Dos Partitions)

6. Raid, redundant hardware question

7. accessing dos partitions with wd7000fasst scsi, isc unix 2.2, dos[345]

8. Help, NIS+ Server, NIS Client

9. Uninstall Linux: Deleted "non dos partition" with DOS fdisk -- Now what?!?

10. HELP: Connectivity between DOS/DOS and DOS/Linux

11. Mini Linux coexists in DOS partition and boot from DOS

12. Mount DOS on DOS machine from LINUX on LINUX machine

13. Installing Solaris 2.6 on drive with existing DOS partitions