Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I correct Gentoo's root on Grub2 ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
West201
Tux's lil' helper
Tux's lil' helper


Joined: 22 Dec 2011
Posts: 115

PostPosted: Thu Dec 29, 2011 1:42 am    Post subject: How do I correct Gentoo's root on Grub2 ? Reply with quote

I've re installed Fedora on a partition after Gentoo is now fully functional. Fedora wrote grub2 on the MBR and grub2 recognizes Gentoo, but when select Gentoo I get message saying to correct the root. Here is my grub.cfg.


### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="${saved_entry}"
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 load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora Linux, with Linux 3.1.6-1.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set=root 2be23c75-16ee-4e68-a94c-4975ed3f8d5e
echo 'Loading Linux 3.1.6-1.fc16.x86_64 ...'
linux /boot/vmlinuz-3.1.6-1.fc16.x86_64 root=UUID=2be23c75-16ee-4e68-a94c-4975ed3f8d5e ro rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.1.6-1.fc16.x86_64.img
}
menuentry 'Fedora Linux, with Linux 3.1.6-1.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set=root 2be23c75-16ee-4e68-a94c-4975ed3f8d5e
echo 'Loading Linux 3.1.6-1.fc16.x86_64 ...'
linux /boot/vmlinuz-3.1.6-1.fc16.x86_64 root=UUID=2be23c75-16ee-4e68-a94c-4975ed3f8d5e ro single rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.1.6-1.fc16.x86_64.img
}
menuentry 'Fedora Linux, with Linux 3.1.0-7.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set=root 2be23c75-16ee-4e68-a94c-4975ed3f8d5e
echo 'Loading Linux 3.1.0-7.fc16.x86_64 ...'
linux /boot/vmlinuz-3.1.0-7.fc16.x86_64 root=UUID=2be23c75-16ee-4e68-a94c-4975ed3f8d5e ro rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.1.0-7.fc16.x86_64.img
}
menuentry 'Fedora Linux, with Linux 3.1.0-7.fc16.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos4)'
search --no-floppy --fs-uuid --set=root 2be23c75-16ee-4e68-a94c-4975ed3f8d5e
echo 'Loading Linux 3.1.0-7.fc16.x86_64 ...'
linux /boot/vmlinuz-3.1.0-7.fc16.x86_64 root=UUID=2be23c75-16ee-4e68-a94c-4975ed3f8d5e ro single rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.1.0-7.fc16.x86_64.img
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Gentoo Base System release 2.0.3 (on /dev/sda3)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root fd7639a5-295b-4335-a32d-777eeb066f71
linux /boot/kernel-genkernel-x86_64-3.0.6-gentoo root=/dev/sda3
}
### END /etc/grub.d/30_os-prober ###





-----HERE ARE MY PARTITIONS----------------
Gentoo Boot Partition /dev/sda1 62d5868d-1461-454b-8987-aa6d4e352d94
Swap /dev/sda2
Gentoo /dev/sda3 fd7639a5-295b-4335-a32d-777eeb066f71
Fedora /dev/sda4
------------------------------------------------------

Thank you so much for your help :)
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Dec 29, 2011 2:36 am    Post subject: Reply with quote

Hello,
root can be the one of Grub or the one of Linux kernel. According to your grub.cfg, you can deal with root of Grub2 (hd0,msdos3) for Gentoo, but it can be easier to understand root=/dev/sda3 then root=UUID=2be23c75-16ee-4e68-a94c-4975ed3f8d5 for kernel command line. The point is 'Is Gentoo really in partition 3 of the first SCSI disk? If yes, try at boottime to use /dev/sda3 as kernel root path. The only way you can be sure you use actually the good UUID, is to question the meta data of the ext{2,3,4} filesystem (it is according to Grub) with dumpe2fs.

If you want to be in control of Grub2, you can disable (chmod -x) the os prober script in /etc/grub.d/ and create your own entry for Gentoo in the 40_custom file of the same directory. Then, update-grub will add the entry in the menu of Grub.
Back to top
View user's profile Send private message
West201
Tux's lil' helper
Tux's lil' helper


Joined: 22 Dec 2011
Posts: 115

PostPosted: Thu Dec 29, 2011 3:27 am    Post subject: Reply with quote

Logicien wrote:
Hello,
root can be the one of Grub or the one of Linux kernel. According to your grub.cfg, you can deal with root of Grub2 (hd0,msdos3) for Gentoo, but it can be easier to understand root=/dev/sda3 then root=UUID=2be23c75-16ee-4e68-a94c-4975ed3f8d5 for kernel command line. The point is 'Is Gentoo really in partition 3 of the first SCSI disk? If yes, try at boottime to use /dev/sda3 as kernel root path. The only way you can be sure you use actually the good UUID, is to question the meta data of the ext{2,3,4} filesystem (it is according to Grub) with dumpe2fs.

If you want to be in control of Grub2, you can disable (chmod -x) the os prober script in /etc/grub.d/ and create your own entry for Gentoo in the 40_custom file of the same directory. Then, update-grub will add the entry in the menu of Grub.


Well I'm a hardcore n00b, so let me give you a little info regarding the error. When use the info in grub.cfg posted above and I select Gentoo from the grub menu. I'll get the error below when trying to boot into Gentoo.



Code:
"UFS: Cannot open root device "sda3" or unknown-block (0,0)

Please append a correct "root=" boot option; "
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Dec 29, 2011 3:57 am    Post subject: Reply with quote

Second tough,
do you have an initrd to use with the kernel of Gentoo? if yes, it is not include has a Grub command line in the menu entry you use to boot Gentoo from Grub. You have to add that line in /boot/grub/grub.cfg or edit the entry itself from the Grub menu to add it. Without extended 2, 3 and 4 filesystems compiled in the kernel, this one have to find the support for it in the initrd. If not, it will be impossible for the kernel to mount the root partition and will failed to boot the system.

First tough,
it look like if the kernel cannot use the good filesystem support for your partition that is, I say it again, ext{2,3,4} detected by Grub. UFS is not what a Linux user will use for the Gentoo root partition, or it is Gentoo on a BSD kernel. You can append the rootfstype=ext4 parameter to the kernel command line to help it to use the good one.
_________________
Paul
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5910

PostPosted: Thu Dec 29, 2011 7:52 am    Post subject: Reply with quote

afaik, you need to edit /etc/grub.d/40_custom or something like that.
but I don't know if you need to sync it with fedora's files as I don't know how fedora works on the matter.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
West201
Tux's lil' helper
Tux's lil' helper


Joined: 22 Dec 2011
Posts: 115

PostPosted: Thu Dec 29, 2011 8:11 am    Post subject: Reply with quote

Thanks for all your answers.

But the problem was grub was thinking the boot & root partition were the same. So I booted using the live cd and installed grub2, and then entered chroot without mounting the boot partition then ran "grub2-mkconfig -o /boot/grub2/grub.cfg", and it was now able to detect the boot partition..
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum