Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] grub-mkconfig generates wrong root uuid
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
linux_os2
Apprentice
Apprentice


Joined: 29 Aug 2018
Posts: 225
Location: Zedelgem Belgium

PostPosted: Thu Apr 04, 2024 7:19 pm    Post subject: [SOLVED] grub-mkconfig generates wrong root uuid Reply with quote

Code:
grub-mkconfig -o /boot/grub/grub.cfg.wrong
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.3-gentoo-x86_64
Found initrd image: /boot/initramfs-6.8.3-gentoo-x86_64.img
Found linux image: /boot/vmlinuz-6.8.3-gentoo-x86_64.old
Found initrd image: /boot/initramfs-6.8.3-gentoo-x86_64.img
Found linux image: /boot/vmlinuz-6.8.1-gentoo-x86_64
Found initrd image: /boot/initramfs-6.8.1-gentoo-x86_64.img
Found linux image: /boot/vmlinuz-6.8.0-gentoo-x86_64
Found initrd image: /boot/initramfs-6.8.0-gentoo-x86_64.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Linux From Scratch (12.0-systemd) on /dev/md126p12
Found Linux From Scratch (12.0-systemd) on /dev/md126p13
Found Linux From Scratch (12.0-systemd) on /dev/md126p14
Found Gentoo Linux on /dev/md126p6
Found Gentoo Linux on /dev/md126p7
Found Ubuntu 22.04.1 LTS (22.04) on /dev/nvme0n1p1
Found Linux From Scratch (12.0-systemd) on /dev/nvme0n1p3
Found Windows Boot Manager on /dev/nvme0n1p4@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done


Quote:
/boot/grub/grub.cfg.wrong


https://bpa.st/JOKQ

extract:
Code:
menuentry 'Gentoo Linux (on /dev/md126p6)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-c9247467-374b-41c2-a72f-57a37d3e6d7b' {
   insmod part_gpt
   insmod ext2
   set root='hd8,gpt6'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint='hd8,gpt6'  c9247467-374b-41c2-a72f-57a37d3e6d7b
   else
     search --no-floppy --fs-uuid --set=root c9247467-374b-41c2-a72f-57a37d3e6d7b
   fi
   linux /boot/vmlinuz-6.8.1-gentoo-x86_64 root=UUID=1ee5e55b-8c70-432e-a93a-1af2f013d007 ro resume=UUID=b4b1cbec-4e1f-4da7-88d7-5ebc50492090
   initrd /boot/initramfs-6.8.1-gentoo-x86_64.img
}

Code:
root=UUID=1ee5e55b-8c70-432e-a93a-1af2f013d007

is the root of the first gentoo linux partition on /dev/md126p5.
all entries for /dev/md126p6 and /dev/md126p7 are wrong.
the ubuntu and lfs entries are ok.


Last edited by linux_os2 on Sun Apr 07, 2024 12:53 pm; edited 2 times in total
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2963
Location: Edge of marsh USA

PostPosted: Fri Apr 05, 2024 4:33 am    Post subject: Reply with quote

Do you have any UUID set in /etc/grub.d or /etc/default/grub? Maybe study /etc/fstab. Reconcile with ls -l /dev/disk/by-uuid/?

Hand jam your own grub.cfg, or hand jam a custom.cfg which should normally be shown during boot. The general format is:
Code:
$ more /boot/grub/custom.cfg
#timeout=5
#default=0
#menu_color_normal=white/blue

#menuentry "Text you'd like to use" {
#   set root="hd0,gpt2"
#   linux /<name of kernel> root=UUID=<UID #> <other options>
#   initrd /<initrd file if you use one>
#   }

#menuentry 'Linux' {
#   set root='hd0,msdos1'
#   linux /vmlinuz root=/dev/nvme0n1p2 ro acpi_enforce_resources=lax
#   }

_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
linux_os2
Apprentice
Apprentice


Joined: 29 Aug 2018
Posts: 225
Location: Zedelgem Belgium

PostPosted: Fri Apr 05, 2024 9:04 am    Post subject: Reply with quote

Thanks Andy,

I will hand jam the generated /boot/grub.cfg.
it's not so much work and i prefer the order that grub-mkconfig generates.
that's easier for my automated backup that use the lfs system uses via grub-reboot reboot.
Back to top
View user's profile Send private message
linux_os2
Apprentice
Apprentice


Joined: 29 Aug 2018
Posts: 225
Location: Zedelgem Belgium

PostPosted: Sun Apr 07, 2024 12:52 pm    Post subject: Reply with quote

Finally found the root cause of the problem.
The 2 other gentoo linux systems were clone of the main gentoo partition.
One of the profile 17.1 merged and one just after migration to profile 23.
UUID's of fs and fstabs were adapted.
Analysed script's:
    /etc/grub.d/30_os-prober
    /usr/bin/linux-boot-prober
    usr/lib/linux-boot-probes

linux-boot-probes parses the grub.cfg of the partition involved.
And of course the entry for that system points still to the old UUID.

booted each system an ran grub-mkconfig.
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