Click to See Complete Forum and Search --> : Can a Linux boot from a bootloader in its own active logical partition?
saikee
07-22-2004, 04:49 AM
The answer seems to be “no” so I would be please to hear from anybody who has managed it.
Let me make it absolutely clear first that there is no problem to boot a Linux from a logical drive if
(1) its bootloader resides in the MBR.
(2) It bootloader resides in the extended partition
(3) by chainloading it via another Linux (using either Grub or Lilo)
(4) by Windows’ own bootloader (not done it personally)
My interest is to make a logical “active” and try to boot it without assistance from a primary partition, the extended partition or the MBR. I am exhausting the options of making Windows inactive in its first primary partition and not touching the MBR but boot it with a Linux placed anywhere within the hard drive.
So far it is a brick wall whenever I try to boot a Linux from a logical partition with the bootloader confined to its own partition.
--------------------confusion of the role of extended partition----------------------
Just a surprise I discovered – I could place the bootloader on the extended
partition (qualified as one of the four primary partitions) to boot a Linux, although an extended partition is not supposed to have anything except the logical partitions. It can’t even be seen in cfdisk. Due to my limited experience in Linux I haven’t come across people putting the bootloader there but it apparent work satisfactorily.
Is it illegal to do it?
Seem to me it is a nice, perfect and neutral spot for a Linux bootloader from which every system in hard drive can be chainloaded. A Linux does not offer this choice to put its bootloader in an installation but Grub and Lilo don't seem to have a second thought whenever I ask.
I could place the bootloader on the extended partition
Very interesting!
I thought I'd tried just about everything, but not for a second did I consider putting bootloader in the extended partition! :eek: :eek:
Thanks a lot for that tip!
As for booting directly fropm a logical volume, this depends on the BIOS. I haven't seen a BIOS that does this, not even on brand new computers.
Anybody managed it?
saikee
07-22-2004, 06:20 AM
X
As I mentioned before cfdisk would not show up the extended partition hda4 in the screen, pressumably there is nothing to put in there apart from in name only. Fdisk does show it up as a sum of all logical partitions and also its status.
I used Lilo's command "Lilo -A /dev/hda 4" to deactivate all other partitions and made partition 4 active, checked with "Lilo -A /dev/hda" which confiemed it was indeed in hda4, got Lilo to place the bootloader there (by "Lilo -b /dev/hda4") and booted from it. Therefore I jumped to a Linux that uses Grub's command "grub-install /dev/hda4" and have that Linux became the boot manager of all 8 Linux plus Xp in the hdd.
I am preserving the boot menu of every Linux and expanding them to include other OS so that any Linux in the extended partition can call up all the 9 booting choices. They are already able to do it inside their own partitions by chainloading regardless the choice of the bootloader.
Not sure if that is of interest to anybody but Linux can be booted from a partition other than its own. I accidentally installed Suse's bootloader in Fedora's partition and discovered the mistake while chainloading the two from a third Linux.
-------------------------- To readers wondering why use logical drive to boot----
(1) This is to facilitate Windows users by keeping Linux away from the MBR and making the Windows partition inactive. The Windows system can be retored by activating its partition so the solution is neat. Linux can already do this if it occupies a primary partition.
(2) Linux if bootable from a logical partition can then leave all three primary partitions to other systems (only a maximum of 4 primary partitions in any hdd, an extended partition counts as one primary).
(3) It serves to demonstrate the flexibility and power of Linux over other operating systems, a Linux can chainload any operating system if it exists in the partition table, which is read into the BIOS before Linux enters the computer system.
saikee
07-25-2004, 08:01 AM
OK I am replying my own post after no one interested to reply, apart from X.
This answer appears to be “Not possible” without a radical change to the BIOS set up.
Here are the findings of my investigation conducted after putting up the thread. Please find free to correct any error.
(1) Each hard drive is allowed only 4 primary partitions. That information is stored between the 447th and the 510th bytes (4x16 bytes) of the first sector of the drive.
(2) One extended partition can replace one primary partition. When this is chosen no more extended partition is permitted.
(3) Only a primary or an extended partition is bootable at any one time. This information is picked up by the BIOS by looking at only the first sector or 512 bytes of the hard disk in a one-pass operation.
(4) The extended partition is physically the logical partition which has a reduced partition table. That partition table points to location of the next logical partition. Thus each logical partition is consecutively chained.
The BIOS locates a bootable primary partition only and must move on if it can’t find one. It is outside its scope to look beyond the 512 bytes of the first sector. That job is what a bootloader has been invented for.
---------------------------------------------------------------
On the subject of placing the bootloader in the extended partition I have put up a separate thread (http://www.justlinux.com/forum/showthread.php?s=&threadid=131039) to attract opinions.
XiaoKJ
07-25-2004, 09:41 AM
It is possible to have more than 1 extended partition, and the logical use of it is to have hda1 primary, hda2 extended, hda3 primary and hda4 extended.
However, you will have to excliptly set your system to support that as it is very weird. I think you must have your kernel compiled to support it. Or at least edit something.
But its not recommended and it has no meaning.
A bootloader is always needed, and you will need one for all OSes. Windows 9x had a stupid one, which is just the MBR which does it. The MBR is a place to put your partition table, some other important stuff and maybe your bootloader. It would automatically chainload the first and primary partition if you have one, which windows uses. you can set the MBR to load other partitions too, but they must be the 4 primary ones.
If you have grub in primary partition 2, you can use it! just set that partition active and it will autoload on each boot.
To clarify, the first 512 bytes of grub (stage 1) and lilo tries to load important stuff, like test for changes and stuff like that. Then for grub it will jump to stage 2 (or 1.5) and load the configfile if available. For lilo it will just start, and give a menu based on what it had, therefoer you must run /sbin/lilo to update it everytime.
therefore if you put the bootloader in the extended partition, it will work, but it may conflict with your system. And there is no reason to do so.
I think fdisk can set extended partition active.
cfdisk is used for newbies and therefore you can see why its not giving that option away -- an unknowing user may set it active with no bootloader and lose his sanity trying to figure out why.
I think a better way to set up multi-boot is this:
1) primary, windows
2) primary, active, boot partition of 1st installed linux distro.
3) primary, swap
4) extended
5....) root of all other OSes.
Then use the active partition to chainload other OSes -- even other grub! I mean, taking that you have slackware, gentoo and freebsd, and you installed gentoo first, then you can have the gentoo's grub in the active partition to boot slackware and freebsd, and have slackware's bootloader installed into its own logical partition. It will be a better way around things.
Note: I even have DOS! there goes another partition!