From: Charles Hedrick (hedrick@athos.rutgers.edu)
Date: 09/25/92


From: hedrick@athos.rutgers.edu (Charles Hedrick)
Subject: Re: Can Linux boot up from extended partitions?
Date: 25 Sep 1992 07:28:29 GMT

oyang@cs.monash.edu.au (Kai Shing O'Yang) writes:

>Sorry if it is an FAQ, but is it possible? One thing I like best for
>OS/2 2.0 is the ability to use the boot manager utility to boot up
>different OS's in different partitions. Has anyone tried to use this to boot
>up Linux?

Yes. I currently have all of my Linux partitions as logical
partitions inside a single DOS extended partition (which also has some
real DOS logical partitions). The extended partition has enough space
before the first logical partition to allow for a boot block.

I'm using LILO. I have installed LILO in the boot area of the
extended partition, pointing it at the root partition. That happens
to be /dev/hda6, though that fact isn't critical. Here's what I use
in the LILO install script (note that this has to be rerun everytime I
install a new kernel):

 /etc/lilo/lilo -b /dev/hda3 -i /etc/lilo/boot.b $* /vmunix /vmunix.NEW
         /vmunix.OLD bsd=/etc/lilo/chain.b+/dev/hda1@/dev/hda
         dos=/etc/lilo/chain.b+/dev/hda4@/dev/hda

(This is all on one line.) Note that this gives me the option of
bringing up Linux with any of three kernels from the extended
partition, 386BSD from partition 1, and DOS from partition 4.

When I execute this command, I'm running with root on /dev/hda6. So
it writes a bootstrap in /dev/hda3, which is the beginning of the
extended partition, pointing to /vmunix, etc., in /dev/hda6. (To set
this up I built a kernel that has /dev/hda6 as the boot device and
copied it to a floppy. Then I booted from the floppy. That gave me a
system running from /dev/hda6.)

I'm actually using the normal DOS master boot record, so I have the
extended partition marked as active. No standard fdisk will do this.
(They all "know" it's impossible to boot from an extended partition, I
guess.) If I were doing it again, I'd use -b /dev/hda rather than -b
/dev/hda3. That would give me LILO as the master boot record. (I
wanted a normal MBR because I was having wierd problems getting 386BSD
to come up, and thought it might have something to do with the MBR.
It didn't.) That could be done using standard software. My current
setup required a modified version of fdisk, to allow me to mark the
extended partition as active.

Incidentally, I've used fdisk to change the type codes on all the
logical partitions that I use for Linux. (I'm using the Minix/Linux
type code, though it doesn't really matter what type you use, as long
as it isn't one DOS knows about.) That way there's no danger that DOS
will try to access them.