Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3474

Why does one of my drives boot but not the other? (Grub efi)

$
0
0
I am having some trouble getting my boot partition one of my drives to work.

My drive setup is two NVMe SSDs setup identically with one of each:
- GPT
- 949MB boot partition
- 930GB data partition

Each data partition has an identical LUKS2 volume (same password).
Each LUKS2 volume has a BTRFS filesystem inside, that is set as a RAID 1 between the two (decrypted) LUKS volumes.

Because I wanted to RAID1 these two disks but couldn't RAID1 the /boot partitions, I am manually ensuring the disk I rarely boot from has a working /boot partition and grub installed to it.

Currently, my first boot drive is severely broken, and I am relying on my backup grub to boot (lucky me for having the second grub!)
Secureboot is enabled, and fully functional on my second disk. (Using Debians system CA in the motherboard)

So now I am attempting to track down why one /boot partition and grub works, but the other does not. I have most certainly broken something on the first drive but I cannot seem to find what is broken (even after multiple grub updates, reinstalls).

Just to note, nvme1n1 is the working drive that I currently boot from.

Code:

fdisk -lDisk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectorsDisk model: WD_BLACK SN770M 1TB                     Units: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: gptDisk identifier: 65AD34DD-A930-4C85-9489-A02D288C270DDevice           Start        End    Sectors   Size Type/dev/nvme0n1p1    2048    1945599    1943552   949M Linux filesystem/dev/nvme0n1p2 1945600 1953523711 1951578112 930.6G Linux filesystemDisk /dev/nvme1n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectorsDisk model: WD_BLACK SN770 1TB                      Units: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: gptDisk identifier: 94237C4B-87F2-4795-9F3C-296FB8278E72Device           Start        End    Sectors   Size Type/dev/nvme1n1p1    2048    1945599    1943552   949M Linux filesystem/dev/nvme1n1p2 1945600 1953523711 1951578112 930.6G Linux filesystemlsblkNAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTSnvme0n1         259:0    0 931.5G  0 disk  ├─nvme0n1p1     259:1    0   949M  0 part  /boot└─nvme0n1p2     259:2    0 930.6G  0 part    └─crypt_nvme0 254:0    0 930.6G  0 crypt /nvme1n1         259:3    0 931.5G  0 disk  ├─nvme1n1p1     259:4    0   949M  0 part  /backupboot/efi└─nvme1n1p2     259:5    0 930.6G  0 part    └─crypt_nvme1 254:1    0 930.6G  0 cryptblkid/dev/nvme0n1p1: UUID="A490-28B5" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="primary" PARTUUID="5fb2891d-33f7-48a0-b021-efdc358653b3"/dev/nvme0n1p2: UUID="63780057-f91e-426d-9be3-84383fd9b534" TYPE="crypto_LUKS" PARTLABEL="primary" PARTUUID="b6d69209-d214-4256-9192-a6f772e490c4"/dev/nvme1n1p2: UUID="c434a425-6552-4036-ae34-4f8c1c728d9a" TYPE="crypto_LUKS" PARTLABEL="primary" PARTUUID="5e37cdf0-8828-49e4-9e16-4583be15b4c2"/dev/nvme1n1p1: UUID="D2D5-D83C" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="primary" PARTUUID="13286ee6-2fd0-4b1f-b8b0-953f504fcbd9"
My attempt at a fresh install to the first drives /boot (I had to specify efi dir because otherwise grub won't continue because /boot/grub would be inside the LUKS volume - don't ask me how the second drive manages to work mounted in the efi subdir...)

Code:

rm -rf /boot/*mkdir /boot/efimkdir /boot/grubcat /etc/default/grubGRUB_DEFAULT=0GRUB_TIMEOUT=2GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`GRUB_CMDLINE_LINUX_DEFAULT="quiet"GRUB_CMDLINE_LINUX=""update-grubGenerating grub configuration file ...Warning: os-prober will not be executed to detect other bootable partitions.Systems on them will not be added to the GRUB boot configuration.Check GRUB_DISABLE_OS_PROBER documentation entry.Adding boot menu entry for UEFI Firmware Settings ...donegrub-install --efi-directory=/boot/efi --uefi-secure-boot /dev/nvme0Installing for x86_64-efi platform.Installation finished. No error reported.apt install --reinstall linux-image-6.1.0-27-amd64find /boot/boot//boot/efi/boot/efi/EFI/boot/efi/EFI/debian/boot/efi/EFI/debian/grubx64.efi/boot/efi/EFI/debian/grub.cfg/boot/grub/boot/grub/x86_64-efi..../boot/grub/grub.cfg/boot/grub/locale..../boot/grub/fonts/boot/grub/fonts/unicode.pf2/boot/grub/grubenv/boot/grub/.background_cache.png/boot/config-6.1.0-27-amd64/boot/vmlinuz-6.1.0-27-amd64/boot/System.map-6.1.0-27-amd64/boot/initrd.img-6.1.0-27-amd64

The working /boot directory (/backupboot) looks like this:

Code:

find /backupboot//backupboot//backupboot/efi/backupboot/efi/EFI/backupboot/efi/EFI/grub2/backupboot/efi/EFI/grub2/shimx64.efi/backupboot/efi/EFI/grub2/grubx64.efi/backupboot/efi/EFI/grub2/mmx64.efi/backupboot/efi/EFI/grub2/fbx64.efi/backupboot/efi/EFI/grub2/BOOTX64.CSV/backupboot/efi/EFI/grub2/grub.cfg/backupboot/efi/EFI/grub2b/backupboot/efi/EFI/grub2b/shimx64.efi/backupboot/efi/EFI/grub2b/grubx64.efi/backupboot/efi/EFI/grub2b/mmx64.efi/backupboot/efi/EFI/grub2b/fbx64.efi/backupboot/efi/EFI/grub2b/BOOTX64.CSV/backupboot/efi/EFI/grub2b/grub.cfg/backupboot/efi/System.map-6.1.0-26-amd64/backupboot/efi/config-6.1.0-26-amd64/backupboot/efi/grub/backupboot/efi/grub/x86_64-efi..../backupboot/efi/grub/locale..../backupboot/efi/grub/fonts/backupboot/efi/grub/fonts/unicode.pf2/backupboot/efi/grub/grubenv/backupboot/efi/grub/grub.cfg/backupboot/efi/grub/unicode.pf2/backupboot/efi/initrd.img-6.1.0-26-amd64/backupboot/efi/vmlinuz-6.1.0-26-amd64/backupboot/grub/backupboot/grub/grub.cfg
The two grub.cfgs:

Code:

cat /backupboot/efi/EFI/grub2b/grub.cfgsearch.fs_uuid D2D5-D83C root set prefix=($root)'/grub'configfile $prefix/grub.cfgat /boot/efi/EFI/debian/grub.cfg search.fs_uuid A490-28B5 root set prefix=($root)'/grub'configfile $prefix/grub.cfg
After redo'ing the /boot install,

Code:

efibootmgrBootCurrent: 0005Timeout: 0 secondsBootOrder: 0003,0000,0005,2001,2002,2003Boot0000* grub2Boot0001* Windows Boot ManagerBoot0002* EFI PXE 0 for IPv4 (0C-37-96-80-1C-81)Boot0003* debianBoot0004* Windows Boot ManagerBoot0005* grub2bBoot2001* EFI USB DeviceBoot2002* EFI DVD/CDROMBoot2003* EFI Network
There's entries, but when I reboot, the UEFI does not have an option for debian (or even grub2).
So I have to use my backup grub2b option to get back in.

Once Im back up, I check efibootmgr again, and the options have disappeared.

Code:

after rebootefibootmgrBootCurrent: 0005Timeout: 0 secondsBootOrder: 0005,2001,2002,2003Boot0001* Windows Boot ManagerBoot0002* EFI PXE 0 for IPv4 (0C-37-96-80-1C-81)Boot0004* Windows Boot ManagerBoot0005* grub2bBoot2001* EFI USB DeviceBoot2002* EFI DVD/CDROMBoot2003* EFI Network
How can I fix the first drive boot?
I realize my second boot drive might not be correct either, but until I can successfully boot with the first drive, I won't touch the second drive (its my only way into to my pc)

Statistics: Posted by looplin — 2024-11-09 20:11 — Replies 2 — Views 73



Viewing all articles
Browse latest Browse all 3474

Trending Articles