bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Grub Manual - suggestions


From: Thomas Frayne
Subject: Grub Manual - suggestions
Date: Thu, 12 Sep 2002 21:26:31 -0700

The Grub Manual does not appear to document a way to report documentation errors. Please add a section describing this.

I am attaching a note I just posted to comp.os.linux.setup. It describes the way I installed Grub, and the difficulties I had before getting a successful installation.

Please consider adding information to the sections on the install command:
1. The install command should not be used unless the setup command is not adequate for your needs. 2. Examples of cases where setup will not work are: ... (If there aren't any, install should be described as an internal command used only by setup). 3. To use install correctly you need to understand embed, stage1, stage1.5, stage2, config_file, real_config_file, ... See ...

Please give separate descriptions of the syntax for install with just stage2 and with both stage1.5 and stage2. Give an example of each case, and a description of the effect of each parameter in the example. Describe when stage 1.5 is needed as part of the install.

I found the "slightly more detail" paragraph incomprehensible, even after multiple readings, and even after I saw the commands issued by setup. Please describe what the command does without any options first. Then describe the effect of each option separately. The most confusing thing was the commingling of the descriptions of stage1.5 and stage2. Please keep them separate throughout.

Please describe the parameters and behavior of setup in a way that does not require reference to install. I would prefer it if the install command were not even mentioned on the setup description page. Move the description of image_device out of the first paragraph and into a separate paragraph.

Please give examples of usage of the setup command with explanations of what each example does.


Thomas Frayne

-----------------------------------------------------------------------------

Newbie novice installed Grub on Redhat 7.3 with separate /boot partition, dual boot Windows XP

I installed Redhat 7.3 Linux plus Win4Lin 4.0 to use Grub as the boot loader for dual boot with Windows XP on a system with 4 SCSI hard drives. The /boot directory was on a separate partition. Later I added a Data Express IDE hard drive enclosure to allow mounting removable IDE hard drives, and bought a 40 GB and a 100 GB hard drive to mount in the enclosure. I had booting problems after doing this, starting with the fact that my Aopen AX6BC motherboard with Award BIOS would not let me change the boot sequence, so the MBR had to be on the mounted removable hard drive. I decided to install Grub on each removable hard drive. How I did this is a long story, but I'll tell the short version first.

After logging on as root, I created the /boot/grub directory and copied to it:
        /usr/share/grub/i386-redhat/*, /etc/grub.conf, /sbin/grub
I executed:
        cd /boot/grub
        ./grub
This activated the grub shell.  I issued the grub command:
        setup (hd0)  (hd2,0)
The response was
        Checking "/boot/grub/stage1"    no
        Checking "/grub/stage1"         yes
        Checking "/grub/stage2"         yes
        Checking "/grub/stage1_5"               yes
Running "embed/grub/e2fs_stage1_5 (hd0)" 22 sectors are embedded Running "install /grub/stage1 d (hd0) (hd0)1+22" p (hd2,0)/grub/stage 2 /grub/grub.conf
I executed
        quit
and rebooted. The Grub boot menu was displayed, and operated correctly. End of the short version.

If it's this easy, why bother writing this note? Well, I spent two days and multiple tries to figure out how to do it, so I thought others might benefit from my experience.

From the Grub Manual, http://www.gnu.org/manual/grub/html_mono/grub.html, the setup command syntax is:

setup [--force-lba] [--stage2=os_stage2_file] [--prefix=dir] install_device [image_device]

Thus (hd0) specifies the install_device as disk 0, which starts with the MBR, and (hd2,0) specifies the image_device, which is the boot partition, which is mounted at /boot. (hd2,0) is partition 0 on drive 2. The Grub names
(hd0)   (hd1)   (hd2)   (hd3) ...       (hd2,0) (hd2,1) ...
correspond to Linux names
hda             sda     sdb     sdc ...         sdb1            sdb2 ...



The response to the setup command indicated that there was no /boot directory on the image device, which is the boot partition, (hd2,0), but that this partition contains the needed files in the /grub directory. It took several iterations for me to discover that the boot partition is treated as the root directory by Grub. I think that if I had specified (hd2,1), which is my root partition, as the image device, the setup command would have found the /boot/grub/* files via the root directory and the mounted /boot directory. This is the way a user without a separate boot partition would do it.

Next, setup embedded the Stage 1.5 file for the ext2 file system in the 22 sectors after the MBR. Finally, it installed stage 1 in the MBR, with stage 1.5 in the next 22 sectors, and stage2 and grub.conf left where they were. It patched the installed stage 1.5 with pointers to stage2 and grub.conf, I think. (The description is under the install command in the Grub Manual, but I haven't been able to discover how the description fits the command issued by setup. Perhaps p stands for patch, and the remainder of the setup command is just copied after the 22 sectors.)

At boot time, after BIOS and SCSI BIOS have done their things, the MBR is loaded and given control. It is only 512 bytes, so all it can do is load the first sector of stage 1.5, and give it control. The first sector of stage 1.5 loads the rest of stage 1.5, which loads stage 2, and gives it control. Stage 2 executes and interprets grub.conf, which controls the rest of the boot process.

grub.conf was set up during my original install of Linux, and modified during installation of Win4Lin. It displays a menu allowing me to boot the original Redhat kernel, the Windows XP boot loader, or the Win4Lin kernel.

My big problem was starting off with the wrong manual. The GNU GRUB Boot Loader LG #64 does not mention the setup command, and has an incomplete description of the install command. Time after time, I studied the document, tried to guess at what it meant, and tried doing the install, only to get a system that would not boot. At one point, I got the Grub shell booted. The next boot I had enough information from the grub.conf file to manually enter the root, kernel, initrd, and boot commands, and I successfully completed the boot. However, I was unable to find a way to have the grub.conf file executed by the boot loader. At this point I found the Grub Manual, http://www.gnu.org/manual/grub/html_mono/grub.html. Even though the install command description advises using setup, I continued trying to find a way to use install, without success. When I finally switched to setup, success came very quickly.

I have no idea whether what I came up with is the best solution, but it worked. It seems to me that there should be a GUI (graphical user interface) for installing or re-installing Grub, but I was unable to discover one. The Redhat install procedure includes a Grub GUI, so it should be trivial to build one to be invocable from Gnome. Does anyone know of an existing GUI? If not, I'll try to build one myself when I've had more than two weeks experience with Linux.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]