GentooThis forum is for the discussion of Gentoo Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I installed Gentoo amd-64, in a external hard drive, on a computer running arch.
At first Grub wouldn't recognize gentoo, until I found out I didin't have os-prober installed. After installation, and running "sudo grub-mkconfig -o /boot/grub/grub.cfg", grub finally recognized gentoo.
But when I tried to boot gentoo, by choosing the gentoo entry in the grub menu, it boots arch instead.
I looked at grub.cfg and noticed a couple of things:
1 - the "set root" defined goes to the boot partition of the arch disk,
2 - the UUID's on the configuration, correspond to the boot and root partition of the arch disk.
I tried changing these values manually on the grub.cfg file (although I know I shouldn't), to the ones on the gentoo disk, but it didn't change anything.
Any help or suggestions would be greatly appreciated.
Below goes my partition list and the contents of grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
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 {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos4' --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4 0c169834-97a0-4dc0-9b71-28987366e636
else
search --no-floppy --fs-uuid --set=root 0c169834-97a0-4dc0-9b71-28987366e636
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=15
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=15
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/06_grub-customizer_menu_color_helper ###
### END /etc/grub.d/06_grub-customizer_menu_color_helper ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-0c169834-97a0-4dc0-9b71-28987366e636' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=0c169834-97a0-4dc0-9b71-28987366e636 rw quiet
echo 'Loading initial ramdisk ...'
initrd /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-0c169834-97a0-4dc0-9b71-28987366e636' {
menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-0c169834-97a0-4dc0-9b71-28987366e636' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=0c169834-97a0-4dc0-9b71-28987366e636 rw quiet
echo 'Loading initial ramdisk ...'
initrd /initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-0c169834-97a0-4dc0-9b71-28987366e636' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=0c169834-97a0-4dc0-9b71-28987366e636 rw quiet
echo 'Loading initial ramdisk ...'
initrd /initramfs-linux-fallback.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_proxy ###
menuentry "Gentoo/Linux (on /dev/sdc4)" --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-eacee572-c583-4995-ac17-7dcf50e1d96f' {
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
linux /vmlinuz-linux root=UUID=0c169834-97a0-4dc0-9b71-28987366e636 rw quiet
initrd /initramfs-linux.img
}
### END /etc/grub.d/30_os-prober_proxy ###
### BEGIN /etc/grub.d/41_os-prober_proxy ###
submenu "Advanced options for Gentoo/Linux (on /dev/sdc4)"{
menuentry "Arch Linux (on /dev/sdc4)" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--eacee572-c583-4995-ac17-7dcf50e1d96f' {
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
linux /vmlinuz-linux root=UUID=0c169834-97a0-4dc0-9b71-28987366e636 rw quiet
initrd /initramfs-linux.img
}
menuentry "Arch Linux, with Linux linux (on /dev/sdc4)" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--eacee572-c583-4995-ac17-7dcf50e1d96f' {
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
linux /vmlinuz-linux root=UUID=0c169834-97a0-4dc0-9b71-28987366e636 rw quiet
initrd /initramfs-linux.img
}
menuentry "Arch Linux, with Linux linux (fallback initramfs) (on /dev/sdc4)" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--eacee572-c583-4995-ac17-7dcf50e1d96f' {
insmod part_msdos
insmod ext2
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
linux /vmlinuz-linux root=UUID=0c169834-97a0-4dc0-9b71-28987366e636 rw quiet
initrd /initramfs-linux-fallback.img
}
}
### END /etc/grub.d/41_os-prober_proxy ###
### BEGIN /etc/grub.d/42_custom_proxy ###
# 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/42_custom_proxy ###
### BEGIN /etc/grub.d/43_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/43_custom ###
I have done that and also changed the UUID's to mirror the Gentoo's boot and root disk.
Now I get a grub error message saying it couldn't find vmlinuz-linux file and that I need to load the kernel.
I also don't know how to proceed from here.
At the grub menu hit c for the grub command line then ls for list of disk/ partitions that grub sees to determine what the disk/ partition for root= needs to be
I've now altered the grub.cfg gentoo entry to reflect the right root partition.
When I tried to boot, it told it couldn't find "vmlinuz-linux" file. As I only have a "vmlinux" file in gentoo (located in /usr/src/linux-4.9.95-gentoo), I assumed it was equivalent and changed the entry to make grub look for "vmlinux".
As it still returned the same error message, I inserted the whole path in the entry. The error message persists, although now states it can't find "vmlinux".
My current grub.cfg for gentoo is the following;
insmod part_msdos
insmod ext2
set root='hd1,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
linux /run/media/miguel/eacee572-c583-4995-ac17-7dcf50e1d96f/usr/src/linux-4.9.95-gentoo/vmlinux root=UUID=eacee572-c583-4995-ac17-7dcf50e1d96f rw quiet
initrd /initramfs-linux.img
rootdelay=20
That is probably what it happened but, since then I changed it again and now the file changed as did its behaviour. As I said, first it booted to arch, now it tells me it can't find the kernel.
Usually you do not need swap. Assuming you have more than a certain amount of RAM.
And you can use one swap partition for any linux. Except you run tuxonice hibernating feature.
Suggestions:
I suggest using lvm2 containers. (
If not use something equivalent which is easy readable and the kernel should not have the possibility to mix up partitions. lvm2 better as UUID better as sdXY / hdXY)
the boot partition is usually on sda2. anything else can be refered with lvm2 containers.
The purpose of a boot partition is to have the boot files there. Just don'T do this: linux /run/media/miguel/eacee572-c583-4995-ac17-7dcf50e1d96f/usr/src/linux-4.9.95-gentoo/vmlinux
I suggest copy over the kernel to boot with a proper name.
the kernel itself, I assume you read the posts on forums.gentoo.org or wiki on how to build it, is located in
Assuming you use 32bit or amd64. Both refer to the same file.
Assuming you set the kernel symlink to the correct kernel source by hand with ln -s
I tell the grub2 bootloader, my boot partiton resides in sda2 = set root='hd0,gpt2'
Therefore "linux /4.9.96-gentoo-26-04-2018" refers to a file which is a file in sda2. Boot files, like grub.cfg / kernel / initramfs belong to the boot partition, which is usually in sda2. careful it is not /boot/4.9.96-gentoo-26-04-2018. when the system is mounted, sda2 is mounted in /boot, than it is /boot/4.9.96-gentoo-26-04-2018
In your case you usually need rootfstype (use the same when you use ext4 for root).
And than you should use real_root= parameter which is also named root=. When you are using luks you need crypt_root
the initrd line is suggested, first is the intel microcode. The instructions on hwo to setup can be found in the gentoo wiki.
typical ubuntu / linux mint grub2 garbage. Just don't use that
Quote:
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos2' --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 f51cc451-1576-4aba-852a-e23af142ebec
else
search --no-floppy --fs-uuid --set=root f51cc451-1576-4aba-852a-e23af142ebec
fi
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.