PDA

View Full Version : [SOLVED] Dual boot problem: RHEL 5.4 and Ubuntu 10.04



JaggMo
June 20th, 2011, 03:47 PM
Hi,

I initially installed RedHat Enterprise Linux 5.4 on my PC.

Partitions:
/dev/sda1 - /boot
/dev/sda3 - /
/dev/sda7 - swap

My RHEL config file located in /boot/grub/grub.conf & grub.conf file contains:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-164.el5.img
title Other
rootnoverify (hd0,4)
chainloader +1

Then, I installed Ubuntu 10.04 choosing the option to install alongside of RHEL

Partitions:
/dev/sda8 - ext4
/dev/sda9 - swap

My Ubuntu 10.04 config file located in /boot/grub/grub.cfg & contains:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,8 )'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,8 )'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,8 )'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=fa4c854b-4507-471c-a496-6a3e0957702f ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,8 )'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=fa4c854b-4507-471c-a496-6a3e0957702f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,8 )'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,8 )'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###


Now, the Ubuntu Startup menu not listing RHEL menu entry and am not able to boot into RHEL.
Pls help me to fix the issue....

oldfred
June 20th, 2011, 07:48 PM
Have your tried and you may want to download the lvm2 package first:


sudo update-grubIf not download and run this:
Boot Info Script courtesy of forum members meierfra & Gert Hulselmans
Page with instructions and download:
http://bootinfoscript.sourceforge.net/
Paste contents of results.txt in a New Reply, then highlight entire file and click on # in edit panel(code tags) to make it easier to read.
Or You can generate the tags first by pressing the # icon in the New Reply Edit toolbar and then paste the contents between the generated [ code] paste here [ /code] tags.
V60 has improved formating and requires code tags to make it legible. New Version is a zip file that you have to extract to get .sh to run.
Install these before running script:
Is able to search LVM partitions if the LVM2 package is install
# ("apt-get install lvm2" in debian based distros)
# Is able to search Linux Software Raid partitions (MD Raids) if
# the "mdadm" package is installed.
sudo apt-get install mawk

JaggMo
June 21st, 2011, 06:24 AM
Hi oldfred,

Thank u for ur info on how to use web forum as I'm new to ubuntu, ubuntu community & forum. It really helps me to improve my behavior on forum how to use.

I installed lvm2, then i tried to install mdadm but it showed "mawk is already the newest version".
Then i ran the script. Pls find the result tagged below as per ur instruction:


Boot Info Script 0.60 from 17 May 2011


============================= Boot Info Summary: ===============================

=> Grub2 (v1.97-1.98) is installed in the MBR of /dev/sda and looks at sector
1 of the same hard drive for core.img. core.img is at this location and
looks in partition 8 for /boot/grub.

sda1: __________________________________________________ ________________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files: /grub/menu.lst /grub/grub.conf

sda2: __________________________________________________ ________________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 63.
Operating System:
Boot files:

sda6: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: According to the info in the boot sector, sda6 starts
at sector 63.
Operating System:
Boot files:

sda7: __________________________________________________ ________________________

File system: swap
Boot sector type: -
Boot sector info:

sda8: __________________________________________________ ________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 10.04 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda9: __________________________________________________ ________________________

File system: swap
Boot sector type: -
Boot sector info:

sda3: __________________________________________________ ________________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Red Hat Enterprise Linux Server
release 5.4 (Tikanga) Kernel on an
Boot files: /etc/fstab

============================ Drive/Partition Info: =============================

Drive: sda __________________________________________________ ___________________

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 * 63 208,844 208,782 83 Linux
/dev/sda2 1,028,221 192,696,397 191,668,177 f W95 Extended (LBA)
/dev/sda5 81,915,498 125,291,430 43,375,933 7 NTFS / exFAT / HPFS
/dev/sda6 163,830,933 192,696,397 28,865,465 7 NTFS / exFAT / HPFS
/dev/sda7 1,028,223 9,414,089 8,385,867 82 Linux swap / Solaris
/dev/sda8 9,414,656 78,843,903 69,429,248 83 Linux
/dev/sda9 78,845,952 81,913,855 3,067,904 82 Linux swap / Solaris
/dev/sda3 220,508,190 241,473,014 20,964,825 83 Linux


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/sda1 71c8193e-7a66-4bfc-ba3f-240444f19bc7 ext3 /boot
/dev/sda3 617d9f69-3c77-4c4d-81ab-e40c749571da ext3 /
/dev/sda5 E0902A36902A1396 ntfs Applications
/dev/sda6 E438D3AF38D37ECC ntfs Education
/dev/sda7 swap
/dev/sda8 fa4c854b-4507-471c-a496-6a3e0957702f ext4
/dev/sda9 557672b0-348c-4467-ad05-409407434f19 swap

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/sda8 / ext4 (rw,errors=remount-ro)


============================= sda1/grub/grub.conf: =============================

--------------------------------------------------------------------------------
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-164.el5.img
title Other
rootnoverify (hd0,4)
chainloader +1
--------------------------------------------------------------------------------

=================== sda1: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

0.015201092 = 0.016322048 grub/grub.conf 1
0.015201092 = 0.016322048 grub/menu.lst 1
0.012622356 = 0.013553152 grub/stage2 2
0.012522221 = 0.013445632 initrd-2.6.18-164.el5.img 12
0.010642529 = 0.011427328 vmlinuz-2.6.18-164.el5 9

=========================== sda8/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=fa4c854b-4507-471c-a496-6a3e0957702f ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=fa4c854b-4507-471c-a496-6a3e0957702f ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,8)'
search --no-floppy --fs-uuid --set fa4c854b-4507-471c-a496-6a3e0957702f
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
--------------------------------------------------------------------------------

=============================== sda8/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda8 during installation
UUID=fa4c854b-4507-471c-a496-6a3e0957702f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda9 during installation
UUID=557672b0-348c-4467-ad05-409407434f19 none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
--------------------------------------------------------------------------------

=================== sda8: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

14.631092072 = 15.710015488 boot/grub/core.img 1
14.722419739 = 15.808077824 boot/grub/grub.cfg 1
15.044704437 = 16.154128384 boot/initrd.img-2.6.32-21-generic 1
14.688323975 = 15.771467776 boot/vmlinuz-2.6.32-21-generic 1
15.044704437 = 16.154128384 initrd.img 1
14.688323975 = 15.771467776 vmlinuz 1

=============================== sda3/etc/fstab: ================================

--------------------------------------------------------------------------------
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda7 swap swap defaults 0 0
--------------------------------------------------------------------------------

oldfred
June 21st, 2011, 02:18 PM
If grub2's os-prober cannot find the Red Hat entry you have to manually convert the grub legacy entry to grub2 and paste it into 40_custom. Copy grub2 version from below:

gksudo gedit /etc/grub.d/40_custom
sudo update-grub


Grub legacy format:
title Red Hat Enterprise Linux Server (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-164.el5.img

Grub2 format:

menuentry "Red Hat Enterprise Linux Server (2.6.18-164.el5)" {
set root=(hd0,1)
linux /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd.img
}

JaggMo
June 21st, 2011, 04:47 PM
Hi oldfred,

If I understood & followed ur intsruction correctly...

First, I entered in terminal...
gksudo gedit /etc/grub.d/40_custom

then, copied ur Grub2 format...


menuentry "Red Hat Enterprise Linux Server (2.6.18-164.el5)" {
set root=(hd0,1)
linux /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd.img
}finally...
sudo update-grub

When i restarted pc, i was able to see Redhat menu entry in the startup menu.
But when i chose Redhat, it hanged, unable to boot and gave me error message:
Kernal Panic - not syncing: VFS: Unable to mount root fs on unknown-block (0,0)

Then i slightly changed ur Grub2 format, specifically in initrd line as below:


menuentry "Red Hat Enterprise Linux Server (2.6.18-164.el5)" {
set root=(hd0,1)
linux /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-164.el5.img
}Then. i'm able to boot into Redhat and it works fine now... :D

But anyway, i need to confirm it from u whether i have done it correct or not.

Further, i am having another issue... in Redhat..

ONLY when my Bluetooth Dongle is connected to USB port, Redhat gives me error message, during shutting down, as below in a scrambled manner filled with the entire screen. It's not showing normal shutdown scripts.

hci_scodata_packet: hci0 SCO packet for unknown connection handle 92

But it shuts down fine when Bluetooth dongle is not present.

I am not sure whether the issue is b'coz of dual OS. The reason i'm questioning u here b'coz I didn't have this problem when i had Redhat alone in my PC.
I'll be glad IF u are able to provide fix for this issue... Otherwise no problem...

Anyway U are my Xavior & u REALLY GREAT....:popcorn:

oldfred
June 21st, 2011, 11:26 PM
If it works you must have done it correctly. I missed the edit to the initrd line as I was copying from an example I know works but adding your versions from your old grub listing. It also needed the change you added. Good job. The differences between a grub legacy entry and grub2 are format and one digit difference in partition numbers.

I do not know about blue-tooth at all. I have no devices so I have not had to deal with those issues. But I do remember a post a while back where a user had to manually edit blue tooth registration/config numbers for his keyboard to get it to work in a dual boot. Only the first pairing would work, so he had to find the numbers from (windows I think) and copy to Ubuntu's config file. Possibly something similar??

JaggMo
June 22nd, 2011, 07:02 AM
Even Am not sure about that. Anyway my primary issue has been solved. Will get in touch with u later.
Thank u so much & have a great days ahead Oldfred.... ;)