# Solved: grub boot edit



## jrbuergel (Jan 17, 2004)

I have Windows XP installed on the internal IDE drive alone, and then I put Ubuntu 7.10 onto my external SATA hard drive. I then resized the windows main C partition and installed the newest PCLinuxOS next to XP in newly created partitions on that internal hard drive, and it did make a new GRUB boot menu, but did not include Ubuntu on the list. Since I did print out the original /boot/grub/menu.lst file from Ubuntu, how can I add the correct line of boot information for Ubuntu 7.10, so that I can select to boot up either Linux from either the internal or the external drives?


----------



## saikee (Jun 11, 2004)

As easy as ABC.

You external hard disk will be looked upon as the 2nd disk by Grub and Ubuntu's Grub will be in its first partition known as (hd1,0) to Grub, mening the 1st partition of the 2nd disk, as Grub counts from zero.

Just add these line to PCLinuxOS's /boot/grub/menu.lst


```
title Ubuntu in (hd1,0)
root (hd1,0)
configfile /boot/grub/menu.lst
```
The above instruction asks Grub to treat (hd1,0) as the root partition and fire up the Ubuntu's /boot/grub/menu.lst. Nothing to it.

Alternatively you can restire Ubuntu's Grub inside the root partition and do it by chainloading. When you see PCLinuxOS booting menu just press "esc" key and to change the graphic to text screen. At the text screen press "c" to drop youself into a Grub prompt. At Grub prompt these instruction retore Grub "inside" the root partition.

```
root (hd1,0)
setup (hd1,0)
```
Thereafter you can fire up Ubuntu, either manually whenever you are in a Grub prompt or by adding the PCLinuxOS's menu.lst by the commands

```
[COLOR="Red"]title Ubuntu in (hd1,0) booted by chainloading[/COLOR]
root (hd1,0)
chainloader +1
[COLOR="Blue"]boot[/COLOR]
```
You can omit the first line if booting from the Grub prompt. The last line can be omitted if booting with menu.lst.


----------



## jrbuergel (Jan 17, 2004)

Will that result in a 2nd GRUB boot menu when selecting Ubuntu from the PCLinuxOS grub list, or can I just add in Ubuntu? Also if I just re-install Ubuntu 7.10 into the same partitions onto my external SATA drive, then it should add itself to the main GRUB boot menu list, right?


----------



## saikee (Jun 11, 2004)

If you allow the PCLinuxOS to arrange it then you boot Ubuntu directly without going through its menu.lst. The latter is to boot Ubuntu indirectly.

If you update Ubuntu the newer version will appear in Ubuntu's own menu.lst.

To boot Ubuntu directly with PCLinuxOS you just copy and paste the booting entry of Ubuntu's menu.lst into PCLinuxOS menu.lst.

You can arrange Ubuntu to be booted directly and indirectly "simultaneously". Every Ext2/3 partition has its first sector reserved permanently as the boot sector. If you put Grub there, by setup command, it only occupies its rightful place. In other word you can have 10 Linux and every one can hold its own boot loader. To boot one boot loader with another is to boot the OS indirectly. In Grub it is known as chainloading and Lilo does it too. That is exactly how every MS Windows is booted by a Linux. There is no PC system in existence that cannot be booted indirectly so it is actually a better and easier method to learn and use.


----------



## jrbuergel (Jan 17, 2004)

This issue is fixed by copy and paste the exact Ubuntu Linux grub items listed in the menu.lst file, accessed from booted into my other Linux, (PCLinuxOS), into the active current GRUB, and thanks for the help.


----------

