Triple-Boot with GRUB

Hello alltogether !

On trying to triple-boot WindowsXP,Suse11.3 and Ubuntu,I learned,
that Linuxes arent much easy to handle,like XP,too.Of course,I first installed XP,but then the problems appeared:I wish to have the nice Suse-Grub at startup,and not the ugly 1.98-1ubuntu7-Grub,cause I
havent the skills to change the background for Grub yet. But on installing Suse as the last one,I didnt manage it to get
Ubuntu into Suses Grub-menu (trying in Yast,but Suse don`t likes to
know Ubuntu,but the XP!).
Installing Ubuntu as the last one,I get the “ugly Grub”,but having
all the three OS in the Grub-menu.
What have I to do,when I wish to delete Ubuntu on this
partitioning-scheme :

/dev/sda1 HPFS/NTFS XP
/dev/sda2 W95 FAT32 (LBA) Daten
/dev/sdb1 Linux Swap / Solaris Swap
/dev/sdb2 Linux Ext4 /
/dev/sdb3 " " /usr
/dev/sdb4 W95 Ext. (LBA) -
/dev/sdb5 Linux Ext4 /home
/dev/sdb6 " " Ubuntu /
/dev/sdb7 " " " /usr
/dev/sdb8 " " " /home
/dev/sdb9 " " Linuxdaten

The Suse-Grub has XP and Suse in its menu,but what happens,if I
delete the Ubuntu-partitions and enlarge the Linuxdaten-partition?
Will the Suse-Grub start automatically at booting,or do I have to
change any settings before ?

In anticipation of your help

lostinspace

If you decide to keep grub2 (not a bad choice in your case), here’s how to customize the background.

Under Ubuntu:

  • Put a jpg image you like anywere on your disk. In this example, that will be /usr/local/share/images/spash.jpg
  • Make a copy of the file /etc/grub.d/05_debian_theme first.
    sudo cp /etc/grub.d/05_debian_theme /etc/grub.d/05_debian_theme.orig
  • Open the original file with a text editor (gedit under Ubuntu or kwrite under Kubuntu)
    sudo gedit /etc/grub.d/05_debian_theme
  • Add the text in red. Of course it has to match the path of your background image:
.../...
# check for usable backgrounds
use_bg=false
for output in ${GRUB_TERMINAL_OUTPUT}; do
  if  "$output" = "gfxterm" ] ; then
    for i in /usr/local/share/images/splash.jpg /boot/grub/`basename ${WALLPAPER}` ${WALLPAPER} ; do
      if is_path_readable_by_grub $i ; then 
        bg=$i
        case ${bg} in
          *.png)                reader=png ;;
          *.tga)                reader=tga ;;
          *.jpg|*.jpeg) reader=jpeg ;;
        esac
        if test -e /boot/grub/${reader}.mod ; then
          echo "Found background image: `basename ${bg}`" >&2
          use_bg=true
          break
        fi
      fi
    done
    break
  fi
done
.../...
  • save this file and run the following command:
    sudo /usr/sbin/update-grub

Reboot and it will look as ugly as the background you chose. :wink:

Hello again !

Sorry,when I tried to edit the wrong formatting,I was stopped by the
admin,caused by time-out !
Hope,you can read it nethertheless !

lostinspace

The fact that Ubuntu doesn’t appear in openSUSE’s Grub menu is a well known limitation. But we can add it easily.
Do you really intend to delete Ubuntu otherwise? (= make a double-boot out of your triple-boot).

Hi please_try_again !

Thanks for your quick response,I`ll try it out.But in Suse,it is different?

lostinspace

Hi please_try_again again !

Yes,I will !I installed Ubuntu because of its software-center mainly.
Meanwhile,I decided to spot my view on Suse,wether I can edit the
Grub-menu,or not !

lostinspace

openSUSE uses an older version of Grub (legacy Grub). Ubuntu uses Grub2. It is quite different. But you can have Ubuntu’s Grub installed in Ubuntu’s partition, openSUSE’s Grub installed in openSUSE’s partition calling each other (this is called ‘chainloading’) in both ways.
Grub2 would be a little bit easier for you (just a little bit), as it doesn’t require to edit the Grub menu file. You just run “update-grub”. But - unless you add other operating systems - you won’t have to. Ubuntu doesn’t appear in openSUSE Grub menu, because openSUSE doesn’t handle Grub2. But, as I said, Ubuntu’s boot entries can be added manually . The following script converts Grub2 to legacy Grub syntax : Extracting Ubuntu (Grub2) boot entries. It might help adding Ubuntu’s entries to openSUSE /boot/grub/menu.lst.

Hello please_try_again !

Just not to misunderstand you : I have only to add my pic-path,or do I have also to delete the /boot/grub…-passage in the line of the script?

lostinspace

Don’t delete any text in this code! Just add your picture’s path! (of course between spaces)

OK,here I`m back again !

I had to ask the question above,because I did not manage to get it work!
The output from the Grub-update seems to be correct(first the new path,then the menu-entries).
I tried it in another place,with other jpgs,nothing(?) happens.
But I discovered,that two of the places,given in 05_debian_theme,
just at the top of the script,are not present on my Ubuntu-system:

  • /usr/share/images is empty
  • /usr/share/desktop-base dont exists Is that normal? But that doesnt matter,I will try your ugrub,to see,if I can get the
    Ubuntu-entries into the Suse- Grubmenu.
    My real topic is,how can I change the Grub,witch is up to start!
    When I delete Ubuntu,I fear, that I can`t boot anymore!

Thanks up to here !

lostinspace

That’s not a problem.

yes

You can install openSUSE Grub in MBR if you prefer to boot from it. That’s up to you. However before doing that, I would install Ubuntu’s Grub in its root paritition if you intend to keep Ubuntu. It’s not absolutely needed but it does make sense.

Right now, yep. Later you could.

I don’t know where/if you installed openSUSE. Anyway, assuming you did and you installed Grub in openSUSE’s root partition, which could be sdb2.
Under Ubuntu you can add the following entry to the file /etc/grub.d/40_custom :

menuentry "openSUSE Grub" {
    set root=(hd1,2)
    chainloader +1
}

As always, you would edit this file with sudo gedit … and rerun sudo update-grub afterwards. Your picture path in /etc/grub.d/05_debian_theme should be a complete file name, not a directory name, with one of the extension .png, .tga, .jpg or .jpeg. You should also make sure that the line

#GRUB_TERMINAL=console

is commented out (starts with a ‘#’) in the file /etc/default/grub.

To install Ubuntu’s Grub in Ubuntu’s root partition, you can use (under Ubuntu):

**sudo grub-install /dev/sdb6**

assuming sdb6 is the Ubuntu root partition.

To install openSUSE Grub in the MBR and boot from it, you can use (under openSUSE):

**grub**
grub> **root (hd1,1)**
grub> **setup (hd0)**

assuming /boot/grub is on device sdb2 under openSUSE.

Notice that sdb2 is (hd1,1) in Legacy Grub syntax and (hd1,2) in Grub2 syntax, since partition numbering starts at 0 under Legacy Grub (openSUSE).

Further you can add the following entry in /boot/grub/menu.lst under openSUSE to chainload Ubuntu Grub from openSUSE Grub:

###Don't change this comment - YaST2 identifier: Original name: UbuntuGrub###
title Ubuntu Boot menu
    root (hd1,5)
    chainloader +1

assuming you previously installed Grub in /dev/sdb6 under Ubuntu.

Notice that chainloading another Grub is not the same as booting another Linux kernel directly. You can have both kind of entries in Grub menu.

Good morning world,especially please_try_again!

Of course I have installed openSuse11.3,your assumption about the
root partitions on my system are right.But I dont know,where I have installed the two Grubs,to know the command for this info,would be nice... The background-change,however,doesnt work!I added the complete,
wright path and the filename,and the line in /etc/default/grub is
commented out,also.
But you have some other interesting infos there for me!Do I under-
stand you wright,that I can put a Grub-entry for the second Grub into
the first Grub-menu,and also an entry for the first Grub into the
second Grub-menu?So,if I cant decide me,I can go from the one of the Grubs to the other,and back again?That will bring us closer to my actual problem! I will try first to get the Ubuntu-Grub into the Suse-Grubmenu,but how can I make the Suse-Grub the active,first one on booting (now the Ubuntu-Grub is the prior one,and dont forget,my XP on the first
disk has to be accessable,too,as it was!)
The different syntax in the Grubs is very confusing.The A-disks are
numbered as 1 in both Grubs,but only the partition-counting differs,
so that,f. e.,the second one is 1 in Suses Grub,but 2 in Grub2? Urrgh!
Also a little bit mysterious for me is the chainload-numbering.Is it
always +1?

Thank you for enabling me not to die too dummish !

lostinspace

Take a look at the findgrub script: Looking for Grub and Windows bootloader in all partitions.
You’ll just have to type: findgrub

I don’t know why. I did checked several times in my Ubuntu installation scripts. I didn’t find anything else. I might still be missing something. When you run update-grub, it should display a message saying that it found the image.

Since openSUSE is in a primary partition on your second harddisk, there are two options.

  • either install openSUSE Grub in the MBR of your first HD (sda). It will replace Ubuntu Grub, which is currently installed there.
  • or install openSUSE Grub in sdb2 (it’s probably already there), make this partition active. It might be active too. Type fdisk -l
    (this is a lowercase l) to find out. The active partition is highlighted with a star, and switch the boot devices order in the BIOS to boot from your second HD.

Yes it is confusing. But I guess you got it. Disk numbering start at 0 in both Grubs. Partition numbering starts at 0 in Legacy Grub and at 1 in Grub2.

chainload +1 means that Grub should read the first sector of the given partition. That’s ususally where the bootcode is located.

Hi,please_try_again!

Short summary of my actions:mounted Ubuntu-/ in /mnt,ran ugrub,
copied 2 of the entries from Grub2 into an file,and also the entry for
the Grub2 itself,yes,and then…
I tried to unmount the Ubuntu-/.Found not the right tutorial at once,
so I improvised a little.Had a message,that lib64 was active,tried on,and then whole the content in /mnt got listet as “not mounted”,
but was listed in the terminal and in Krusader.Removing them
doesn`t work,and since then,not any other root-command could be
executed (always printing "command not found"after legitimation) !!!
My root-command to become chiefcook is working on login,terminal
and in KDE.
Shall I open a new threat for that,or can we get it fixed here?
Anything seems to run in the right order,no other obvious problems.

lostinspace

Just saw, that normal commands worked with root-permission!

lostinspace

I don’t know how openSUSE (or other Linux) organize the mounting of foreign partitions. This is the kind of thing I rather do myself. So here’s how I would do (under openSUSE):

  • become root with : su -l

  • create the directory /ubuntu:

  • mkdir /ubuntu

  • run the command blkid
    or, since we’re only interested in Ubuntu’s partitions, append a filter to get a shorter output (and remove the quotes that we don’t need):

  • blkid | awk ‘/sdb6|sdb7|sdb8/ { print }’ | tr -d “”"

We can redirect this output to a file. ‘Traditionnaly’, I call this file /tmp/**** (aber Du kannst die auch dingens benennen, wie auch immer). So the whole command would be:

  • blkid | awk ‘/sdb6|sdb7|sdb8/ { print }’ | tr -d “”" > /tmp/dingens
    :wink:
  • Now open the file /etc/fstab with a text editor and add the following, replacing the UUID of the corresponding partitions with the ones you just wrote in /tmp/dingens.
# Ubuntu
# /dev/sdb6
UUID=a512b949-eb37-4dd6-a2d4-00a0babca04b  /ubuntu       ext4 defaults,noauto,nodev  0  2
# /dev/sdb7
UUID=907ffb8a-b8f3-46b5-be89-104a787a5ec3  /ubuntu/usr   ext4 defaults,noauto,nodev  0  2
# /dev/sdb8
UUID=457f0ca1-ca7c-4d5d-b984-729e2f8bdd5e  /ubuntu/home  ext4 defaults,noauto,nodev  0  2

I don’t know if your partitions are all formated in ext4. So change that in ext3 if needed. Mouting by UUID is not required. You could also use device names /dev/sdb6, /dev/sdb7, etc instead of UUID … But why make it simple if you can make it complicated? (I’m not a big fan of KISS). In fact, mounting by UUID is safer, specially if you happen to switch devices boot order, since UUID won’t change (until you reformat a partition), device names might.

Those partitions won’t be mounted automatically (noauto). There is no need for that. When you want to mount them, type :

mount /ubuntu
mount /ubuntu/usr
mount /ubuntu/home

In this example, you have to mount /ubuntu first in order to mount the other partitions. If you don’t want that, you can change the mountpoints of sdb7 and sdb8 (directories like /ubuntu_usr and /ubuntu_home would look appropriate).

Of course, Kde, Dolphin & Co let you mount/unmount partitions too.
You can do the same under Ubuntu for your openSUSE partitions. On Unbutu, there is no root by default. So the command “su -l” won’t work. You have to use sudo before each command.

Hello, I also have my system set to triple-boot with W7, ubuntu, openSUSE 11.3. I now have the problem that I installed too many repo’s (widely exceeding the ‘famous four’) and now some software isn’t working anymore. Due to that I want to do a ‘fresh’ 11.3 install, but I don’t know how in the installation menu of the cd I can configure grub in that way so that all 3 systems are choosable on startup. (the last time I installed 11.3 from disk it went wrong and I had to reinstall ubuntu using ubuntu’s grub) Can anyone guide me through the installation process?

Thanks in advance, Frank

You could also remove the bothering repos …
Anyway, if you have Ubuntu Grub in MBR and don’t want openSUSE setup to overwrite it, you have to look in the advanced boot options and uncheck ‘write generic boot code to mbr’. This is a special feature to please Windows users. Of course do not install openSUSE Grub in MBR (unless that’s what you want), install Grub in the openSUSE root partition. ALWAYS choose the last option in the partitioning setup: ‘Create partition setup’, select the partitions you want to use for openSUSE one by one, assign mountpoint and check ‘format’ unless you want to preserve data (like in /home for example).