LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   grub problem (https://www.linuxquestions.org/questions/linux-newbie-8/grub-problem-4175472299/)

mirzasoltan 08-06-2013 04:58 AM

grub problem
 
hi everyone,

i had Fedora 15, and Centos 5.5 in my pc, fedora in a hard disk (/dev/sda) and centos in another hard disk (/dev/sdb)
i add third hard disk (/dev/sdc) and install ubuntu 10.4 in it. after installing ubuntu, centos gone from grub list, in grub there is just ubuntu and fedora.

how can i fix it?!
i try grub recovery and just found ubuntu and fedora, not centos.
tanx.

EDDY1 08-06-2013 05:04 AM

Try mounting centos partitions & running update-grub

mirzasoltan 08-06-2013 05:24 AM

root@ardaneh-ubuntu:~# mkdir /media/centos
root@ardaneh-ubuntu:~# mount /dev/sdb2 /media/centos/
root@ardaneh-ubuntu:~# ls /media/centos/
bin boot dev etc home lib lost+found media misc mnt opt poweroff proc root sbin selinux srv sys tftpboot tmp usr var
root@ardaneh-ubuntu:~# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-50-generic-pae
Found initrd image: /boot/initrd.img-2.6.32-50-generic-pae
Found memtest86+ image: /memtest86+.bin
Found Fedora release 15 (Lovelock) on /dev/sda2
Found CentOS release 5.9 (Final) on /dev/sdb2
done
root@ardaneh-ubuntu:~# cat /boot/grub/grub.cfg
...
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-50-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set c7f7ea49-4178-404b-8460-2d723ecc2c38
linux /vmlinuz-2.6.32-50-generic-pae root=UUID=6909eb58-c9fe-469c-808c-0f5685bba641 ro quiet splash
initrd /initrd.img-2.6.32-50-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-50-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set c7f7ea49-4178-404b-8460-2d723ecc2c38
echo 'Loading Linux 2.6.32-50-generic-pae ...'
linux /vmlinuz-2.6.32-50-generic-pae root=UUID=6909eb58-c9fe-469c-808c-0f5685bba641 ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.32-50-generic-pae
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set c7f7ea49-4178-404b-8460-2d723ecc2c38
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set c7f7ea49-4178-404b-8460-2d723ecc2c38
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Fedora (2.6.40.6-0.fc15.x86_64) (on /dev/sda2)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set e889a008-6616-4388-a1ed-fc9e2b8b35b0
linux /vmlinuz-2.6.40.6-0.fc15.x86_64 ro root=UUID=82b3a603-bbb9-4c45-bd36-e899592576e4 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
initrd /initramfs-2.6.40.6-0.fc15.x86_64.img
}
### 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 ###
root@ardaneh-ubuntu:~#


Centos detected but dont add in grub.cfg list.

EDDY1 08-06-2013 07:03 AM

Quote:

root@ardaneh-ubuntu:~# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-50-generic-pae
Found initrd image: /boot/initrd.img-2.6.32-50-generic-pae
Found memtest86+ image: /memtest86+.bin
Found Fedora release 15 (Lovelock) on /dev/sda2
Found CentOS release 5.9 (Final) on /dev/sdb2
done
It shows detected have you rebooted?

mirzasoltan 08-06-2013 07:30 AM

Quote:

Originally Posted by EDDY1 (Post 5003978)
It shows detected have you rebooted?

yes, i do it many times after "update-grub" from ubuntu/terminal and from ubuntu recovery mode, but every time i reboot in grub just ubuntu, ubuntu recovery, memory test and fedora appear. there is no line for centos.

aus9 08-06-2013 08:59 AM

hi

the first thing you noticed was that your menu was missing a detected OS
but notice that the first entries are for ubuntu
---so you must have have booted into ubuntu or you must have had ubuntu install its grub into MBR of something and take over.

Ideally as each drive has a mbr......but we don't know your bios boot order.....I suggest you want fedora on sda to be the controlling grub?

so try manual commands to get in

at grub menu press C for commands
Code:

set root=(hd0,2)
linux /boot/vml (and press TAB key to autocomplete kernel name,
----you must see something that resembles fedora or I have it wrong so don't continue this way
(lets pretend)
linux /boot/vmlinuz-fedora root=/dev/sda2
initrd /boot/init (and press TAB key to auto complete and choose the matching k to initrd numbers
boot

you have just booted into fedora....assuming grub2 now fix up fedora grub2

Code:

sudo grub-install /dev/sda
re-puts fedora's grub into mbr of sda

may or may not find the other 2 OS but I assume you have os-prober installed in fedora

good luck

#####
set root=(hd0,2) tells grub to look for fedora's /boot partition at hd0,2
if you have a separate /boot partition to / for fedora then change it twice
once for the set root command and drop the leading /boot from the linux and initrd line

aus9 08-06-2013 09:00 AM

if you have some weird partition type you need to tell us....as we may need to insmod <module> for strange partition type

Soadyheid 08-06-2013 10:07 AM

I'm having the same problem after installing Ubuntu 12.04 which has re-written the Grub config files and my Centos system is missing. It may be because Centos uses LVM and I've got it installed over an 8 disk RAID (Yes, I know, total overkill and pointless.) The volume shows up as /dev/cciss0 or something, it's on an HP SmartArray.

The last time I got it working, I had to manually "knit" the 40_custom file to get it to be recognised. So far it gives me "Centos" as a boot option but can't find the kernel. (It was 01:00 this morning when I gave up so I've still a bit of work to do.) I had to define the Root volume by its UUID which worked last time.

Interesting that your system acknowledgd that you had Centos as a choice, mine never has.

I shall watch this post with interest...

Play Bonny!

:hattip:

mirzasoltan 08-08-2013 01:09 AM

tanx everyone for all of your suggestion,
i can not use them but i learn many things ;)
i finally replace ubuntu 12.04.2 Desktop edition with ubuntu 10.4 and my problem solved.
now in grub i have ubuntu, fedora and centos together.

good luck everyone.

EDDY1 08-08-2013 09:10 AM

Quote:

Originally Posted by mirzasoltan (Post 5005342)
tanx everyone for all of your suggestion,
i can not use them but i learn many things ;)
i finally replace ubuntu 12.04.2 Desktop edition with ubuntu 10.4 and my problem solved.
now in grub i have ubuntu, fedora and centos together.

good luck everyone.

It's great to know that
you haveit worked out.


All times are GMT -5. The time now is 04:20 AM.