Extended Linux partition, or why is DOS FDISK so stupid?

Marek Michalkiewicz (marekm@i17linuxb.ists.pwr.wroc.pl)
Thu, 28 Sep 1995 21:55:17 +0100 (MET)


First, let me tell the story...

Got a new WD 850MB (or 814MB depending on the definition of "mega" :-)
hard drive (yes I know IDE sucks but is cheap) and created the following
partitions:

hda1: DOS (about 300MB)
hda2: small DOS partition (about 20MB) for SFS
hda3: Linux root (up to cylinder 1023, to make sure LILO will work)
hda4: extended, from cylinder 1024 to the end (1654)
hda5: Linux swap (about 20MB)
hda6: Linux (to the end)

Linux works happily, but DOS 6.2 FDISK gets in an infinite loop confused
by the extended partition (works after I temporarily change the partition
type to something else using a disk editor, but then of course the two
logical partitions are not accessible from Linux).

I know it is a DOS bug, but I can't fix it (I don't have the source), and
it might be a good idea to work around this problem in Linux by creating
a new partition type: Linux extended partitions. It would work exactly
the same as the normal DOS extended partitions, but a different partition
type byte would not confuse the DOS FDISK program.

The change in linux/drivers/block/genhd.c seems trivial to me. Now here
is another, less trivial idea: to work around the limitations of the
standard PC partitioning system, maybe it should be possible to add
(or remove) partitions dynamically at run time? All that is necessary
at boot time is the root partition, the rest can be added later by some
special program reading some partition config file and using some new
ioctl calls on /dev/[hs]d?. That might also be useful for removable
disks like SyQuest (but I don't have one: how are they handled now?).

I can see one problem with this: non-Linux systems can't access Linux
partitions which are not defined in the standard way (partition table
in the MBR). But the above idea doesn't make the situation any worse.
What do you think?

Marek