LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-15-2009, 02:54 PM   #1
lassik
LQ Newbie
 
Registered: Feb 2009
Posts: 6

Rep: Reputation: 0
Ubuntu / CentOS / Grub issue


I've had Ubuntu installed on my system for awhile now and i recently installed CentOS. I elected to let CentOS install it's own Grub (probably my first mistake). After that, now I don't have an option to boot in to Ubuntu when I start the computer up.

What do i need to edit or change in order to get this back to normal.

Here's what i've got right now.

My original Grub.conf from Ubuntu. (note that the partition that says Ubuntu 7.10 was replaced with CentOS. Ubuntu 7.10 is no longer on the machine)
Code:
title           Ubuntu 8.10, kernel 2.6.27-7-generic
uuid            d2b830a3-898f-4178-b9c7-14910bb7cc8d
kernel          /boot/vmlinuz-2.6.27-7-generic root=UUID=d2b830a3-898f-4178-b9c7-14910bb7cc8d ro quiet splash
initrd          /boot/initrd.img-2.6.27-7-generic
quiet

title           Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid            d2b830a3-898f-4178-b9c7-14910bb7cc8d
kernel          /boot/vmlinuz-2.6.27-7-generic root=UUID=d2b830a3-898f-4178-b9c7-14910bb7cc8d ro  single
initrd          /boot/initrd.img-2.6.27-7-generic

title           Ubuntu 8.10, memtest86+
uuid            d2b830a3-898f-4178-b9c7-14910bb7cc8d
kernel          /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title           Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title           Microsoft Windows XP Professional
root            (hd0,0)
savedefault
makeactive
chainloader     +1


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title           Ubuntu 7.10, kernel 2.6.22-14-generic (on /dev/sda5)
root            (hd0,4)
kernel          /boot/vmlinuz-2.6.22-14-generic root=UUID=4c0cf01a-b115-4327-bde2-0bc6b6d79c65 ro quiet splash
initrd          /boot/initrd.img-2.6.22-14-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title           Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode) (on /dev/sda5)
root            (hd0,4)
kernel          /boot/vmlinuz-2.6.22-14-generic root=UUID=4c0cf01a-b115-4327-bde2-0bc6b6d79c65 ro single
initrd          /boot/initrd.img-2.6.22-14-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title           Ubuntu 7.10, memtest86+ (on /dev/sda5)
root            (hd0,4)
kernel          /boot/memtest86+.bin
savedefault
boot
My new grub.conf file when i installed CentOS
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,4)
#          kernel /boot/vmlinuz-version ro root=/dev/sda5
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-92.1.22.el5)
        root (hd0,4)
        kernel /boot/vmlinuz-2.6.18-92.1.22.el5 ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-92.1.22.el5.img
title CentOS (2.6.18-92.el5)
        root (hd0,4)
        kernel /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-92.el5.img
title Other
        rootnoverify (hd0,0)
        chainloader +1
fdisk -l
Code:
Disk /dev/sda: 250.0 GB, 250058268160 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        4233    34001541    7  HPFS/NTFS
/dev/sda2            4234       30401   210194460    f  W95 Ext'd (LBA)
/dev/sda5           23825       30141    50735128+  83  Linux
/dev/sda6           30141       30401     2094088+  82  Linux swap / Solaris
/dev/sda7            4234       23024   150938644+  83  Linux
/dev/sda8           23025       23824     6425968+  82  Linux swap / Solaris
/dev/sda1 = Windows XP partition
/dev/sda5 = CentOS 5.2
/dev/sda7 = Ubuntu 8.10


I thought that maybe just doing this would fix the issue but i haven't tried it yet because i don't want to mess anything up.
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,4)
#          kernel /boot/vmlinuz-version ro root=/dev/sda5
#          initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
hiddenmenu
title Ubuntu 8.10, kernel 2.6.27-7-generic
	root (hd0,6)
	uuid d2b830a3-898f-4178-b9c7-14910bb7cc8d
	kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=d2b830a3-898f-4178-b9c7-14910bb7cc8d ro quiet splash
	initrd /boot/initrd.img-2.6.27-7-generic
	quiet
title CentOS (2.6.18-92.1.22.el5)
        root (hd0,4)
        kernel /boot/vmlinuz-2.6.18-92.1.22.el5 ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-92.1.22.el5.img
title CentOS (2.6.18-92.el5)
        root (hd0,4)
        kernel /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-92.el5.img
title Other
        rootnoverify (hd0,0)
        chainloader +1
Another thing to note is that i'm not at this machine so i need to be able to make this change, type reboot in the terminal and it boot right back up in to Ubuntu automatically. So i kinda have just 1 chance at this. I can get to the machine if i really need to. Just a bit of a drive to do so.

Any help would be greatly appreciated.

Thank you.
 
Old 02-15-2009, 03:30 PM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Backup Before Experimenting

It looks like CentOS took your position reserved for Ubuntu, and you need to add Ubuntu back. You'll learn a lot by experimenting. Just back the relative files up somewhere safe.

I saw this but did not read it in great detail as to how well it will help you.

https://answers.launchpad.net/ubuntu/+question/37978

You can also use the live CD to put your boot stuff back. Backing up the files helps preserve CentOS, in case using the live CD does to you what installing CentOS did.
 
Old 02-15-2009, 05:20 PM   #3
lassik
LQ Newbie
 
Registered: Feb 2009
Posts: 6

Original Poster
Rep: Reputation: 0
I found out that (hd1,6) is definitely what i need to use as root but here's what i got

Code:
[root@localhost ~]# grub
Probing devices to guess BIOS drives. This may take a long time.
Unknown partition table signature


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> root (hd1,6)
root (hd1,6)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
setup (hd1)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no

Error 2: Bad file or directory type
grub>
I assume this may be because Ubuntu is using a different version of Grub than CentOS is... maybe...
 
Old 02-15-2009, 07:28 PM   #4
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
How about doing the following from your Intrepid Live CD, because it is important to make sure you use the latest Grub that Intrepid has:
Code:
sudo grub
grub> root (hd0,6)
grub> setup (hd0,6)
grub> quit
And then in your CentOS grub.conf add:
Code:
title Ubuntu Grub menu
root (hd0,6)
chainloader +1
Let me know if that works OK or not.
 
Old 02-16-2009, 12:14 AM   #5
lassik
LQ Newbie
 
Registered: Feb 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Well my whole point was that I needed to do it remotely but I went to the site where the server was and did what you said CJS and it worked.

Thank you.
 
Old 02-16-2009, 09:03 AM   #6
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
Glad to hear that worked OK; cheers and enjoy Ubuntu and CentOS.
 
Old 04-30-2010, 05:56 AM   #7
malikjunaid
LQ Newbie
 
Registered: Apr 2010
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by CJS View Post
How about doing the following from your Intrepid Live CD, because it is important to make sure you use the latest Grub that Intrepid has:
Code:
sudo grub
grub> root (hd0,6)
grub> setup (hd0,6)
grub> quit
And then in your CentOS grub.conf add:
Code:
title Ubuntu Grub menu
root (hd0,6)
chainloader +1
Let me know if that works OK or not.
Hi CJS,
I have a similar problem but the ubuntu version i have is ubuntu 9.10 and it have grub2. I can not run the grub command. i tried grub2 but there is nothing like this.
Can you help me what i can do to fix my problem?
thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess issue - CentOS JDMs14 Linux - Security 4 09-15-2009 05:20 PM
LXer: PV-Grub on CentOS 5.2 PV DomU at Xen 3.3 CentOS 5.2 Dom0 (all 64-bit) LXer Syndicated Linux News 0 10-05-2008 11:12 PM
shutdown issue using centos 5.0 alex.archip Linux - Laptop and Netbook 4 09-09-2007 02:01 AM
Ubuntu issue / SATA / GRUB 22 carlitoboss Linux - Newbie 24 03-27-2007 07:28 AM
some help with CentOS PHP issue please! renegadeavenger Red Hat 5 08-08-2005 09:33 PM


All times are GMT -5. The time now is 10:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration