Saturday, June 30, 2012

Booting Ubuntu 10.10(grub2) from Opensuse 12.1(grub1)


I have recently installed OpenSuse 12.1 on a machine which was already running Ubuntu 10.10.

Ubuntu 10.10 comes with grub2 and opensuse 12, with grub1.

So, after installing Opensuse I couldn't boot Ubuntu.

I am not a brave heart to go for grub2 installation on Opensuse.

Searching through google pointed me to many places which presented different solutions and all of them may work.

It is always possible to boot from Ubuntu Live CD and install the grub so that both Opensuse and Ubuntu are registered.

But I wanted to boot from OpenSuse Grub, and it is possible.

First mount the partition where Ubuntu is installed.

For grub2 it is /boot/grub/grub.cfg

Look for the Ubuntu entry.

In My case it is

menuentry 'Ubuntu, with Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 17626223-4abe-4d78-ab7b-6185263e59a3
linux /boot/vmlinuz-3.0.0-12-generic root=UUID=17626223-4abe-4d78-ab7b-6185263e59a3 ro quiet splash vt.handoff=7
initrd /boot/initrd.img-3.0.0-12-generic

when I do fdisk

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b5a73

Device Boot Start End Blocks Id System
/dev/sda1 63 1048594679 524297308+ 83 Linux
/dev/sda2 1048596478 1275158527 113281025 5 Extended
/dev/sda3 * 1275158528 1470470143 97655808 83 Linux
/dev/sda5 1048596480 1243908095 97655808 83 Linux
/dev/sda6 1243910144 1275158527 15624192 82 Linux swap / Solaris

From the Grub entry and fdisk list we see that ,Ubuntu installation is on sda5.

Now edit the menu.lst in the Opensuse by adding these entries

# vim /boot/grub/menu.lst



title Ubuntu
root (hd0,4)
kernel /boot/vmlinuz-3.0.0-12-generic root=/dev/sda5 ro quiet splash
initrd /boot/initrd.img-3.0.0-12-generic

 root  is always <HDD Number, fdisk partiton number -1>  (here sda5, so 5-1=4)
(hd0 -since we have one hard disk )

in the kernel section the actual partition /dev/sda5

save the file and reboot.

Now we can boot to Ubuntu from OpenSuse Grub.




No comments:

Post a Comment