Re: DOS extended partition layout

From: Umberto Quaia (umberto.quaia_at_tin.it)
Date: 01/09/04


Date: Fri, 09 Jan 2004 03:47:43 +0100

On Tue, 6 Jan 2004 07:09:05 -0600, philo <philo@privacy.net> wrote:

>
> "Keve Nagy" <NO_SPAM@poliod.hu> wrote in message
> news:bte104$616qp$1@ID-127951.news.uni-berlin.de...
>>
>>
>> philo wrote:
>> > I did not ask a question...I made a statement.
>>
>> You are correct. My apalogies! It was a statement indeed.
>> So let me correct my words: I found your STATEMENT a bit strange.
>> :-)
>>
>> >
> Probably because I am a bit of an oddball I suppose <g>
>
>
>> > here is an example (just use your own parameters):
>> > mount -t msdos /dev/ad0s5 /dos
>> >
>> See, here is the foundation of our real misunderstandings.
>> ad0s5, s6, and above are all logical units inside a DOS extended
>> partition. A DOS extended partition is a Primary Partition (AKA a slice)
>> although it is never referenced directly on its own. It would be useless
>> as its only purpose is to hold further pieces of disk-areas, called the
>> logical-units or logical partitions.
>> You confused the logical partitions with the extended partition!
>> Your mount command is an example of how to mount a logical dos drive
>> which resides in an extended partition. This can only be done when you
>> know that this dos drive is the first logical unit in the extended
>> partition (s5 = first logical inside the extended). Of course, for this
>> first you have to be able to list the logical units inside the extended,
>> to find out that this one is the first, second, etc.
>> See, my original question was exactly pointing to this. I would like to
>> list the contents of my extended partition (so that I know what to mount
>> when I need something from a logical FAT/NTFS/HPFS or EXT partition).
>>
>> But all this is technically just chewing on some terms or expressions,
>> which I am not intended to do in any more details. :-)
>>
>> The question remains, how can one list the logical drives inside an
>> extended partition using any freebsd tool?
>> Per Hedeland just replied that linux-fdisk is in the ports. I remember
>> when I used Linux that fdisk could really show the logical drives inside
>> the extended. SO this could be a solution. Any other idea, somebody ?
>>
>
>
> Ok ...now that I understand the question I see why you thought my comment
> was odd.
> I've seen comments elsewhere that the FreeBSD partitioning tools
> are less than ideal...and have heard that some prefer to use Linux's fdisk.
>
> Next time I do a FreeBSD install I'll try Linux fdisk instead and make a
> comparison. Although I;ve never had any trouble installing FreeBSD
> with it;s own partitioning utilities...I have noticed that other operating
> systems see the drive as being corrupted! (Though of course to FreeBSD
> it is not)
>
>

Well, I'd say that PC partitioning scheme is odd, not FreeBSD tools.

An odd scheme based on a pile of extended partitions remains odd
even using the best tools...
For each "logical unit" a new couple of
"extended partition"/"partition inside that" is created.

Here is a possible layout (expanding each level every row):

(PRIMARY NTFS)(PRIMARY LINUX)( EXTENDED ONE )(PRIMARY FREEBSD)
(PRIMARY NTFS)(PRIMARY LINUX)((LOGICAL NTFS)( EXTENDED TWO ))((a)(b)(d)(e)(f))
(PRIMARY NTFS)(PRIMARY LINUX)((LOGICAL NTFS)((LOGICAL LXVM )))((a)(b)(d)(e)(f))

LXVM = Linux LVM
(sorry for the inevitable wordwrap...)

Quite funny, it seems a sort of LISP expression... :-P

This is actually the second new extended extended partition layout,
since with the first old extended partition layout (without nested
extended partitions) a limit of four logical drives was in place.
Don't remember since which DOS version they switched to the new one,
probably 4 when they added 2Gb partition/filesystem support.
I personally prefer the old layout whenever the added complexity
is not needed, but many tools create partitions according to the
new layout.

However, as said, Linux FDISK is capable of deciphering that mess
and presenting it in a human form. But I don't think FreeBSD
uses the same Linux numberting (Linux labels the first logical
drive 5 regardless of the position of the extended partition).

Perhaps FreeBSD sees the extended partition as a slice,
numbered depending on position, with drives labeled using
letters a,b,d,e,f according to their position, but I'm not sure
this mechanism is able to go deeper than the first level
and find drives following the first.
Perhaps, passing to diskpart as argument the first extended
partition it's able to find the second one and so on.
Or perhaps the old extended partition layout (just an extended
partition with max 4 logical drives) fits this FreeBSD scheme,
so it would be better to generate a partition layout compliant
with the first old layout, because the new one is not supported.

Anyway, this is the illustrated layout
PARTITION/SLICE WINDOWS FREEBSD LINUX
PRIMARY NTFS: C: /dev/ad0s1 /dev/hda1
PRIMARY LINUX: /dev/ad0s2 /dev/hda2
LOGICAL NTFS: D: /dev/ad0s3a ? /dev/hda5
LOGICAL LXLVM: /dev/ad0s3b ? /dev/hda6
FreeBSD slice: /dev/ad0s4a /dev/hda7 ?
                                  . .
                              . .
                              /dev/ad0s4f /dev/hda11 ?

? means it's a guess, but I'm not so sure

If I remember, FreeBSD slices are seen by Linux
as DOS extended partitions.

In my opinion, FreeBSD slices and vinum are great!
You have the flexibility of managing your FreeBSD filesystems
all in one single primary slice, allowing to share
the IDE drive with Windows or Linux.

FreeBSD vinum permits even to have your filesystems on virtual
volumes, so that they may even be extended as needed, or to have
more than the usual number of partitions inside the slice.

Simply put, FreeBSD tools are not designed with other OSes in mind.

But experimenting a little with mount_ntfs, each time trying a
different combination of ad0s??, you should succeed in identifying
FreeBSD scheme, hoping that the layout is supported... ;-)

If, instead, your intention was to use empty space in the extended
partition and assign it to FreeBSD, I'd say that it's not possible.
FreeBSD needs its own slice (primary partition).

Cheers,
Umberto



Relevant Pages

  • Re: re-write is this booting info correct?
    ... Microsoft/Windows and FreeBSD ... use the word partition to mean different things. ... and ?extended dos partition?. ... containing as many Logical Drives as you like; ...
    (freebsd-questions)
  • Re: Partition Issue (Adding Vista x64 to Vista x32 1TB Drive)
    ... Most of my basic education in hard drives started with floppies on the TRS-80. ... They have usually included at least a detailed copy of the boot sector and the MBR, including the partition table, with a bit-by-bit explanation of what the various flags mean. ... My standard arrangement for a HDD is a single small primary partition to hold nothing but the startup files, with an extended partition covering the rest of the drive, with multiple logical drives. ... "Richard Urban" wrote in message ...
    (microsoft.public.windows.vista.installation_setup)
  • Putting /usr in extended partition at install?
    ... FreeBSD /usr, swap, etc ... I can get the OpenBSD aind Win2k to install where I want them, ... extended partition at all. ... stuff like /usr/X11R6 and /usr/src on other drives. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: cannot install Redhat Linux
    ... With modern drives this should only be done ... Some consider the PT to be part of the MBR, ... > partition can have at most one volume in it. ... In effect, an extended partition is ...
    (Fedora)
  • Re: New installation of FreeBSD with Debian dual boot
    ... The partition editor is a fdisk variant and very flexible. ... I'm looking to install FreeBSD 8.0 on my system today, where it would dual boot with Debian. ... I have the *.iso all ready to go, so just wanted to check a couple of points before I log out of Debian and boot into the DVD to install. ... What's the situation like under FreeBSD for supporting these kinds of external drives? ...
    (freebsd-questions)