Problems booting Gentoo
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 NAME FSTYPE SIZE MOUNTPOINT LABEL sda 465.8G ├─sda1 2M ├─sda2 ext2 128M /boot ├─sda3 swap 512M [SWAP] └─sda4 ext4 465.1G / sdc 465.8G ├─sdc1 2M ├─sdc2 ext2 128M ├─sdc3 swap 512M └─sdc4 ext4 465.1G sr0 1024M Code:
# |
You need to change gentoo set root= line to (hd1,2)
Or possibly hd3 |
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 |
What is on sdc1 and sdc2?
What is the ouput of parted -l |
sdc1 is a bios boot partition and sdc2 is boot.
When I input "parted -l" it tells me it's an invalid option. |
I reread your first post and if your grub menu at boot didn't change after editing then you most likely edited the wrong grub.cfg
|
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.
|
I am going to close this post, as the initial problem is resolved.
|
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 Quote:
I expect that you read the syntax for the grub2 bootloader. here is an example Quote:
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:
|
Thank you _roman, your menu suggestion, and finding out that the disk was hd2, not hd1, solved my problem.
|
All times are GMT -5. The time now is 01:28 PM. |