[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Logical Partitions ...

On Tue, Dec 19, 2000 at 01:22:04PM +0530, Anil Pillai typed:
> To be more precise, I create an extended partition say of 600 MB
> (/dev/hda4) and if I want to create 2 logical partitions (/dev/hda5 and
> /dev/hda6) of say 300 MB each.
> To do this, I feel that this partition should be written on /dev/hda4.
> Please correct me if I am wrong and also do let me know from which byte in
> the first 512 bytes of /dev/hda4 should I start writing this partition.

The first sector of /dev/hda4 will hold the partition table that defines
"logical drives" (MSDOS terminology) in the partition. Even though this
sector looks identical to your primary partition table (i.e only 4
partition table entries with the rest of the stuff wasted), only 2 of
these entries are generally filled up.

The first entry (Starting at offset 0x1BE in the sector) defines the first
logical drive (hda5 in your case). 

The second entry (at offset 0x1CE) is a pointer to another extended
partition. The first sector of this will then have the place for another
4 entries - the first entry of which (at its offset 0x1BE) will be hda6,
and the second entry will point to yet another extended partition (or
will be left blank in the case of the last "logical drive").

Logically I don't see any point why 3 of the 4 partition table entries
couldn't be used to point to 3 drives with the 4th one pointing to an
extension if needed. But unfortunately, that seems to be the way it is
done by most FDISK implementations - and normally you wouldn't want to
take a chance with fooling around with these sort of conventions - else
some errant program that depends on these conventions might trash your
disk :):):)

Also note that each of these partition sectors should have a 0x55, 0xAA
signature in the last 2 bytes (offsets 0x1FE & 1FF respectively).