How to use GRUB to detect the other linux partition
Hi,
Two questions.... I intend to build a multi-OS. 1. Install Windows XP on first primary partition (/dev/sda1) 2. Install Sabayon on first logical partition (/dev/sda6) 3. Install Freespire on the second logical partition (/dev/sda7) i;m able to multi-boot for the windows xp and sabayon, but not the Freespire. During the installation of the Freespire, i chose the option of not writing the MBR. Q1. How could i use GRUB to update the current menu.lst file in sabayon? i know there's another way of manually edit the menu.1st to point to the correct kernel and initrd in the Freespire partition. Q2. By the way, is there any URL or sources that i can refer to for the detailed explanation on GRUB. Thanks a lot for the feedback. Justin |
Quote:
Quote:
Quote:
Boot Sabayon. Edit the menu.lst files in /dev/sda6/boot/grub and /dev/sda7/boot/grub. Compare them. Even if you don't understand most of the details, it should be pretty obvious whether the second one contains everything (so you could just copy the second one overwriting the first) or whether each contains only part of what you need (so you can copy/paste the Freespire content from the second file as extra menu choices in the first file). |
Thanks Johnsfine.
I did the manual editing of the Sabayon grub's file just to make it work. |
|
Anyone here can provide more information on the GRUB ...
Thanks a million... :) |
Try here - you're probably interested in grub legacy.
|
Quote:
|
Grub manual
There is a Grub manual available for download, Google.
Also, I don't know if we can reference another message board, but is so, www.justlinux.com has a thread on how to install like 147 distros, including DOS; Win 95; Win 98; XP; plus a hundred Linux distros, all on one HD. It is believed one cannot put more than one Win on a HD, but a hide command in grub fixes this very well. |
just.srad,
Actually the answer is dead simple. When a Linux is installed and denied the access to the MBR that makes it unbootable. In order to survive the installer will put the boot loader inside the root partition of Freespire. With the exception of a few odd partition types most partitions have set aside the first sector as the boot sector permanently reserved for the boot loader so every Linux can store its boot loader there or the space is simply empty. Every Linux that has a boot loader inside its root partition is chainloadable and can be booted by the exactly the same method a MS Windows is booted. As an example if Linspire is in (hd0,3), the 4th partition of the 1st disk, then these lines in Sabyon's menu.lst will fire it up Code:
title My Linspire in (hd0,3) Chainloading is the method one boot loader boots another boot loader. It is up to the second boot loader boots its master. It is used by every boot loader of substance, including every one from MS Windows. They just haven't got a name for it. That is all. |
?????
>>When a Linux is installed and denied the access to the MBR that makes it unbootable. In order to survive the installer will put the boot loader inside the root partition of Freespire.
I can't say if I agree or disagree with that statement, because I'm not sure exactly what you mean. I have no idea what it means "denied access to the MBR". I suspect I disagree with it, it's just that I am not sure. In December, I installed gOS 1.x in hda11 of an eMachine W3115 I have here in Mexico. When I rebooted, it gave me an fsck error, which required me to use CTRL-D which put me into Ubuntu 6.10. I lived with it until I made a visit to the States. In Virginia, I installed Kubuntu in my old Inspiron 2650, and it gave me the same fsck error. I learned Ubuntu changes partition names, which messes up old /etc/fstab values. So, when I came back, sure enough, that was the problem with the W3115. I ran command: ls /dev/disk/by-uuid/ -alh to obtain correct partition names, and fixed that. Still no gOS. I looked at hda11 from Ubuntu 6.10 and found the names for kernel and intrd, and simply added them into the menu.lst on Mandriva 2007 which is what happened to be running Grub, though that is not what I was booting. If you run into permission problems when trying to edit menu.lst on another partition, either run sudo nano from a terminal, or run sudo kwrite in a terminal. Or, sudo su to get a root prompt, then run kwrite or konqueror in superuser mode. Whatever works on your distro. I typed in that information into the hda7 /boot/grub/menu.lst actually used, like this: title gOS hda11 (directly loaded) root (hd0,10) kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/hda11 ro intrd /boot/initrd.img-2.6.22-14-generic savedefault By directly loaded, I mean there is no chainloader at all. Hda11 does not need access to the MBR. Hda7 handles this, even when you don't boot to hda7. I am not saying there is anything wrong with chainloading, it's just another delay and is not needed at all. When I chainloaded in the past because I was told I had to, I got the grub window with its time-out and choices, then when it chainloaded the other partition, I got that grub window from the second partition, which gave me most of the same choices, with the accompanying delay. |
irlandes,
If you install a Linux and do not want its boot loader in the MBR it cannot boot itself. The standard homes for a Linux boot loader, Grub or Lilo, are (1) MBR (2) Root partition (3) floppy (4) None at all Most installer will go for (2) if (1) is not selected and (3) and (4) are not offered. You can install the boot loader simultaneously in all three (1), (2) and (3) and boot it by any of the three ways you fancy. You don't have to like chainloading but it is one that allows you to forget altering fstab, the types of boot loader, the name of the kernel, the name of the module, the name of initrd ram disk file, by-uuid or by-label partition addressing etc etc. It is the single method you can boot every PC system that has even been invented, regardless it is a Dos, Windows, Linux, BSD or Solaris. More over you can use same instructions changing it only the partition reference for every operating system! If you don't want delay in booting you control it with the "timeout" statement in Lilo or Grub. Technically if you issue kernel and initrd statements in the booting process you boot the Linux directly. To chainload it is to boot the system indirectly. Grub can only directly boot a system if it can read that partition, get inside and load the kernel and initrd. This limits the choice to Linux and Unix-like systems. By comparison Grub can boot any PC system indirectly including systems residing in partitions it cannot read, like NTFS filing system used by Win2k, XP and Vista. In the Justlinux link you mentioned booting 147 systems. I booted every single one of the 147 systems by "chainloading". The same technique can be used by Vista as I tried its BCDedit to boot 150 Linux too. |
Quote:
And, I am well aware you can chain load everything. I just prefer direct loading myself, (edit: except for OS which cannot be loaded directly) and so far it meets all my modest needs. I suppose if I had 147 working, it might change my mind. But, my main point is, we should never try to stop dissemination of all options, for several reasons. People are all different, and even on the simplest issues have personal preferences. Examples are KDE/Gnome/iceWM/Enlightenment. Not to even mention the common distro wars which drive moderators loony. In this case, I think it makes sense to understand both ways of doing it, and then each person makes their own decision for their own needs, as you have done . It matters not if 99% prefer one way and only 1% the other way. The principle reason many come to Linux is because MS has traditionally made such decisions for everyone, with not a lot of choice in a lot of areas. If Linus had held to conventional wisdom, where would Linux be today? I am going to tell you one case where direct loading is helpful. People do somehow screw up the loader when installing multiple OS. People put them through all sorts of folderol, when all they have to do is modify the menu.lst in use, and they are up and running. After that, they can decide what to do. |
Despite I gave the impression I sell "chainloading" hard to everybody in reality I do boot every system directly by its own boot loader.
My statement that I could use one Grub to chainload everyone of the 147 systems only serves to show the technique works as far as I could stretch. In reality Grub chainloads the second boot loader which in turn boots up its own master "directly". I really have no intention stopping others from booting a Linux directly. It does require a fair bit of understanding of the booting commands which can be daunting for the newbies. With chainloading it is an easy way out. I use it a lot on my advice to others because it is easier for me to explain and the result is effective. Also I don't need to know what mistake the poster has committed resulting his/her system unbootable. It is possible the resistance comes from others thinking I am substituting the very basic principle of booting a Linux directly with something too-simple to them. |
This thread did help me understand something I have noted over the years. Mandrake/Mandriva has always placed links in /boot where the kernel and initrd.img are located.
They are called vmlinuz and initrd.img, with no version numbers, and booting is done to those abbreviated filenames which of course are links to the actual kernel and initrd.img to be used. Until you explained this, I had no idea why they did this. I suspect Mandriva does that so the OS can be booted either directly or indirectly. And, it also seems probable that installing an update package for the kernel will also plunk in new links automatically. Thus no matter where you boot from, grub need not be changed. IF that is true, it would seem this should be standard practice for all distros. I am certainly not criticizing anyone for chainloading. My whole point was personal preference, not superiority of either technique, and so it would be somewhat hypocritical to say anything at all negative about chainloading, just because I have chosen not to use it myself. |
All times are GMT -5. The time now is 04:27 PM. |