Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Dec 1997 01:58:11 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@FreeBSD.org, BryanBatten@compuserve.com
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: Using Extended Partitions
Message-ID:  <199712151458.BAA00507@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I've been able to install FreeBSD 2.2.2 on the third partition of the fir=
>st
>drive of a two EIDE drive setup. The INSTALL.TXT file on my Walnut Creek
>CDROM says flatly that I can mount my DOS extended partitions with FreeBS=
>D
>2.2.2. =

More precisely, you can mount supported filesystems on logical drives
within DOS extended partitions (I'll call these logical drives and not
partitions or slices).

>Based on that statement, I've reserved a logical partition within the
>extended partition on my second drive for FreeBSD (using Linux fdisk) -
>with the intent of subsequently using the FreeBSD fdisk to do the "real"
>allocation. Yet when I try to get to it during my FreeBSD installation
>procedure's fdisk portion, I see nothing except the extended partition
>itself. (i.e. the memu stops with wd1s4.)

Neither the standalone fdisk nor sysinstall supports logical drives.
This is not much of a problem for fdisk (just use fdisk on whatever
system used up too many primary partitions to create some more logical
drives), but it makes it hard to install on logical drives.

>The logical partition I put a place holder in for using Linux fdisk is
>"/dev/hdb6", which I *think* is what "/dev/wd1s6" should correspond to.
>
>When I boot BSD, and say "fdisk wd1", I get:
>
>"... /kernel: wd1: cannot find label (no disk label)" twice and
>"... /kernel: wd1s6: cannot find label (no disk label)" twice.

This is probably correct.  There is no disk label because you haven't
written one yet.  The warning is printed only for slices that have type
165.  You apparently set the type using Linux fixes.

>If I try "fdisk wd1s4", I get the above messages plus:
>
>"fdisk: can't get disk parameters on /dev/rwd1s6; supplying dummy ones"

fdisk only works on real drives.  The ioctl to get the disk parameters
is only supported on real drives and labeled slices (it should have been
supported on all slices).

>The partition table info, however, is still correct. Also, the command
>"fdisk wd0s4" also outputs correct values for the extended partion boot
>block on the first drive.

It gets more complicated for multiple logical drives.  They are chained
together, normally with one nested extended partition for each additional
logical drive.  FreeBSD doesn't support slices for easy access to these
extended partitions (they may be found at certain offsets in the top-level
extended partition), and some of the sector offsets are relative.  In
particular, it's hard to see where wd0s6 is.

>If I try "fdisk wd1s6", I get the "cannot find ..." and "can't get ..."
>messages. In addition, the output for the boot block info is incorrect.

This shouldn't be expected to work, since all slices with number >= 5
are logical drives, not extended partitions.

>I've been able to educate myself on the disklabel and newfs commands. And=
> I
>feel that if I can get past this hurdle, I should be able to put myself i=
>n
>business.

Untested hacks to install on a logical drive:
1. Create the drive in its final position using Linux fdisk and note where
   it puts it (use x (expert) mode to get the sector offsets).
2. Create a primary partition in exactly the same place (use x mode to set
   the sector offsets).  You will probably need to delete a primary
   partition to make room, and the extended partition containing the
   logical drive to defeat overlap checking, and all other logical drives
   within that extended partition.
3. Install FreeBSD normally.
4. Undo step 2.

I think you can shortcut steps 2 and 4 by deleting all partitions:
2a. Back up the MBR using dd to copy the sector containing it.
2b. Copy /dev/zero to the MBR to give an empty MBR.
2c. Run any fdisk that supports setting the sector offsets precisely to
    create the FreeBSD partition.
4. Copy the MBR back.
This should work better because it doesn't require deleting the chain of
logical drives.

Bruce



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