Hello everyone!
I have a laptop with Windows 11, vanilla OS 2, and kubuntu 26.04 LTS (in order of installation). I want to make a manual grub configuration, that will offer all three operating systems during boot up and that will be able to boot any future kernel and initrd without needing further modifications. I looked it up and prompted chatGPT, and now I think it is best to ask for some advice before I commit.
I got the idea from John Little in this thread. I considered it best to create a new thread because manual grub configuration could prove future-proof (according to what John mentioned there) and therefore helpful to other members not just myself. Additionally, that specific thread was about partitioning and pre-install, so I felt we were starting to go off-topic.
Following suggestions were produced by the AI tool, with the first one to backup my configuration files:
Code:
sudo cp /etc/default/grub /etc/default/grub.bak sudo cp -r /etc/grub.d /etc/grub.d.bak sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.bak Backup ESP (example ESP = /dev/nvme0n1p1): sudo mkdir -p /mnt/esp && sudo mount /dev/nvme0n1p1 /mnt/esp sudo cp -r /mnt/esp /root/esp-backup sudo umount /mnt/esp
I didn´t copy paste blindly,I copied the entries from the kubuntu grub file (regarding kubuntu and windows entries) and then booted to vanilla and copied the vanilla entries too.
Code:
#!/bin/sh
exec tail -n +3 $0
menuentry 'Kubuntu 26.04' --class kubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-[UUID of kubuntu root partition]' {
recordfail
load_video
set gfxpayload=$linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root [UUID of kubuntu root partition]
linux /boot/vmlinuz root=UUID=[UUID of kubuntu root partition] ro quiet splash $vt_handoff{
initrd /boot/initrd.img
#For the last two lines, I followed this advice: https://help.ubuntu.com/community/Grub2/CustomMenus
}
#linux /vmlinuz root=UUID=[UUID of kubuntu root partition] ro quiet splash
#initrd /initrd.img
menuentry "Vanilla OS - Current State (A)" --class abroot-a {
search --fs-uuid --no-floppy --set=root(lvm/vos--root-init)
configfile "/vos-a/abroot.cfg"
chainloader /boot/efi/EFI/vanilla/grub.cfg # I am not sure about this one... Copied from within Vanilla.
}
menuentry "Vanilla OS - Previous State (B)" --class abroot-b {
search --fs-uuid --no-floppy --set=root(lvm/vos--root-init)
configfile "/vos-b/abroot.cfg"
chainloader /boot/efi/EFI/vanilla/grub.cfg # I am not sure about this one... Copied from within Vanilla.
}
# COMMENT: the ai tool suggested I chainloaded Vanilla´s EFI bootloader, but I copied the above from vanilla´s boot partition. Not sure if it will work...
# AI said: Replace /EFI/OtherDistro/grubx64.efi below with the actual path found under /boot/efi/EFI
# I need to understand what the above line does, haven´t figured it out yet!
#chainloader /boot/efi/EFI/vanilla/grub.cfg # I am not sure about this one... Copied from within Vanilla.
menuentry "Windows 11 - chainload Windows Boot Manager" {
search --fs-uuid --no-floppy --set=root *****
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
# COMMENT: no changes for the win menuentry
- sudo chmod +x /etc/grub.d/40_custom
- sudo update-grub
I have no idea if any of the above will work well... Do they look okay? Did I miss anything important?
Thank you in advance!




Comment