0

I just put together a new machine where Linux is not supported directly by the motherboard manufacturer (a Gigabyte AORUS Elite X WiFi 7).

I initially installed Kubuntu 22.04 LTS, and it was not a good experience. There were many problems, and failed to boot after the install. I was able to boot into recovery mode and get the system running, but continued to run into problems. After an hour of Whack-A-Mole, I decided that I needed to try something else.

I tried installing Kubuntu 23.10 and directed it to do a guided install using the entire disk. The good news is that it works very well. The bad news is that I didn't notice that it installed to the second physical NVMe drive.

This isn't a problem in getting the machine to run, as I just select the first item in Grub, and it boots and runs fine.

The problem is that the first physical NVMe drive still has the original 22.04 LTS installation. I would like to remove unneeded partitions and reformat the first drive and use it as storage in 23.10. My concern is that I don't want to accidentally remove anything needed for the machine to boot into the 23.10 installation. Both installations have similar /etc/grub.d folders and parted shows a fat32 file system named "EFI System Partition" with boot and esp flags on each physical drive.

I am really not very familiar with Grub, so I am not sure what is safe to remove, and what must stay. For example, if I reformat the partition containing 22.04 LTS, I'll lose the /etc/grub.d folder that lives there. Does Grub depend on that, or can I configure it to use the folder in the 23.10 installation?

Any guidance would be appreciated.

Thanks, -Wade

wadeh
  • 49
  • Please copy & paste the pastebin link to the BootInfo summary report ( do not post report), do not run the auto fix till reviewed. Use often updated ppa version with your USB installer or any working install over somewhat older ISO. https://help.ubuntu.com/community/Boot-Repair & Or basically UEFI boot entries use GUID/partUUID to know which ESP to boot from. Then in ESP is a 3 line grub.cfg that uses UUID to find the install to boot from. sudo efibootmgr -v & lsblk -e 7 -o name,fstype,size,fsused,label,partlabel,mountpoint,uuid,partuuid Check partUUID & UUIDs. – oldfred Dec 18 '23 at 22:34
  • Thanks for taking a look. Here is the pastebin link:

    https://paste.ubuntu.com/p/RYK5rMpytq/

    – wadeh Dec 18 '23 at 22:50
  • Boot entry 0000 uses ESP on nvme1n1p1 to boot install in p2 on same drive. Boot entry 0001 uses ESP on nvme0n1p1 and that boots install in p2 on same drive. Using search icon in Firefox. I like to change distributor in /etc/default/grub so description is unique & reinstall grub. Even with new UEFI entry, it uses grub.cfg in /EFI/ubuntu on same ESP. GRUB_DISTRIBUTOR="jammy" or "kubuntu" And comment out current entry in /etc/default/grub.https://askubuntu.com/questions/1198221/cloning-ssd-also-cloned-boot-options/1198228#1198228 – oldfred Dec 19 '23 at 03:52

2 Answers2

0

Thanks very much for looking into this, but I am not sure that you understood my question. I always knew which OS was on which device.

In my much younger days, I understood MBR partition tables and the boot process, but simply haven't needed to understand the internals of boot loaders under UEFI. My concern was that each installation had its own /boot directory and that randomly deleting one would somehow break the loader for the OS on the other drive.

Your first reply served as a bootstrap for me to do some reading. The critical pieces that I was concerned about live in the UEFI BIOS's non-volatile RAM (which is obvious when you think about it, otherwise the system would be way too fragile). Once I understood the boot process and a bit about GPT partitions, I knew that it was safe to just delete the partitions on the drive that contain the 22.04 LTS installation.

Prior to doing actually deleting the partitions, I tried to use efibootmgr and update-grub to edit the boot options (mostly out of curiosity). It turns out that I could not make it work, and they returned after a reboot. I noticed that the internet is littered with reports of this problem, and it is considered a BIOS bug (where the manufacturers make it work in Windows with bcdedit, but apparently don't seem to care about Linux...) Fortunately, after removing the EFI System Partition on the drive with 22.04 LTS, all is well and works the way I want.

Thanks again, and sorry for not being clear about my question in the original post.

-Wade

wadeh
  • 49
0

Take a look at the essential parts of your boot info summary:

======================== nvme0n1p2/etc/fstab (filtered) ========================

<file system> <mount point> <type> <options> <dump> <pass>

/ was on /dev/nvme0n1p2 during installation

UUID=fad010cd-3742-4b82-b630-19fd5e079df3 / ext4 errors=remount-ro 0 1

/boot/efi was on /dev/nvme0n1p1 during installation

UUID=61A1-3769 /boot/efi vfat umask=0077 0 1 /swapfile

======================== nvme1n1p2/etc/fstab (filtered) ========================

<file system> <mount point> <type> <options> <dump> <pass>

/ was on /dev/nvme0n1p2 during installation

UUID=c4f0f64b-7234-4c12-af15-fbf353c2cdad / ext4 errors=remount-ro 0 1

/boot/efi was on /dev/nvme0n1p1 during installation

UUID=0112-A879 /boot/efi vfat umask=0077 0 1 /swapfile none swap sw 0 0

blkid (filtered): ______________________________________________________________

NAME FSTYPE UUID PARTUUID LABEL PARTLABEL nvme1n1
├─nvme1n1p1 vfat 0112-A879 c109befb-8b9c-415d-93e1-79ebcd1a2726 EFI System Partition └─nvme1n1p2 ext4 c4f0f64b-7234-4c12-af15-fbf353c2cdad 63280ac0-47b5-4af4-a1dc-c4e0bce0f86f
nvme0n1
├─nvme0n1p1 vfat 61A1-3769 977db3bf-7f8f-4699-b37d-064abbb8e73c EFI System Partition └─nvme0n1p2 ext4 fad010cd-3742-4b82-b630-19fd5e079df3 639ae122-88da-42c1-8836-5df4d620e92c

It shows clearly that your both installed OS are completely seperated, including there bootloaders. So the OS installed on nvme1n1p2 uses the ESP nvme1n1p1, the OS installed on nvme0n1p2 uses the ESP nvme0n1p1.

When Grub is installed, Grub will also be placed at the first place in the boot order. Since you installed 22.04 first and 23.10 second, now the Grub from 23.10 is in the first place in the boot-order and was used to boot 23.10. The fact that you used the first menu entry in the Gurb menu confirms that.

You can remove 22.04 completely and you can also remove it's Grub by removing the ESP on that disk, you are not using it.

A possible leftover might be an entry in the EFI-boot-menu which may need to be removed manually either via your UEFI-settings or with efibootmgr. This answer describes how to use efibootmgr in such a case. You wouldn't need to do it by booting your installer, just use your installed 23.10 to do it. Also, before doing it, please take a look at man efibootmgr.

mook765
  • 15,925