我朋友有一块主板,上面有一个双 NVMe SSD 插槽,使用 mdadm 在软件 RAID1 中配置。
我们过去已经成功安装了 Ubuntu Studio。
工作过去的配置:
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 931.5G 0 disk
└─nvme0n1p1 259:2 0 931.5G 0 part
└─md127 9:127 0 931.5G 0 raid1
├─md127p1 259:4 0 500M 0 part /boot/efi
├─md127p2 259:5 0 1G 0 part /boot
└─md127p3 259:6 0 930G 0 part
└─ROOTFS 253:1 0 930G 0 crypt
└─VG_SSD_ENCRYPTED-UbuntuStudio 253:2 0 930G 0 lvm /
nvme1n1 259:1 0 931.5G 0 disk
└─nvme1n1p1 259:3 0 931.5G 0 part
└─md127 9:127 0 931.5G 0 raid1
├─md127p1 259:4 0 500M 0 part /boot/efi
├─md127p2 259:5 0 1G 0 part /boot
└─md127p3 259:6 0 930G 0 part
└─ROOTFS 253:1 0 930G 0 crypt
└─VG_SSD_ENCRYPTED-UbuntuStudio 253:2 0 930G 0 lvm /
文件系统
#<file system> <mount point> <type> <options> <dump> <pass>
# Ubuntu Studio ROOTFS
/dev/mapper/VG_SSD_ENCRYPTED-UbuntuStudio / ext4 defaults 0 0
# BOOT
UUID=8c332457-5df5-48bf-bfd9-ea2e8c0e77bf /boot ext4 defaults 0 0
# EFI
UUID=A38C-7AA5 /boot/efi vfat defaults 0 1
山
/dev/mapper/VG_SSD_ENCRYPTED-UbuntuStudio on / type ext4 (rw,relatime)
/dev/md127p2 on /boot type ext4 (rw,relatime)
/dev/md127p1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
加密表
# <target name> <source device> <key file> <options>
md127p3_decrypted UUID=16de9a91-523f-4542-a8e7-2b7a2ea057d9 none luks
块
/dev/mapper/ROOTFS: UUID="iyQ9q9-OSKF-mjYO-jV37-2FDW-1XwQ-hZqNUt" TYPE="LVM2_member"
/dev/nvme0n1p1: UUID="36e82194-8a9e-675a-ff6d-4634df91a171" UUID_SUB="fbd1ef5b-c74b-3265-a20e-c8552af7fa26" LABEL="ubuntu-studio:RAID_SSD" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="559b3506-b9c2-4e0b-a16f-706190670d04"
/dev/md127p3: UUID="16de9a91-523f-4542-a8e7-2b7a2ea057d9" TYPE="crypto_LUKS" PARTLABEL="Linux LUKS" PARTUUID="08ca2107-d019-4378-9943-5e75b8b8022a"
/dev/md127p1: SEC_TYPE="msdos" LABEL_FATBOOT="ESP" LABEL="ESP" UUID="A38C-7AA5" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="44012383-3794-4e23-bb27-840d23cafc70"
/dev/md127p2: LABEL="BOOT" UUID="8c332457-5df5-48bf-bfd9-ea2e8c0e77bf" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Linux filesystem" PARTUUID="126ff1e6-7083-4c6c-a224-28e961509336"
/dev/mapper/VG_SSD_ENCRYPTED-UbuntuStudio: LABEL="UbuntuStudio" UUID="fbb51a49-f185-4144-a666-1cf53e4d73d8" BLOCK_SIZE="4096" TYPE="ext4"
/dev/nvme1n1p1: UUID="36e82194-8a9e-675a-ff6d-4634df91a171" UUID_SUB="e28ee1d1-6c4b-0480-44c4-de68f90fdae7" LABEL="ubuntu-studio:RAID_SSD" TYPE="linux_raid_member" PARTLABEL="Linux RAID" PARTUUID="0d232d4c-08f7-4da2-808a-beba317728ff"
添加 UEFI nvram 条目
sudo efibootmgr -c -d /dev/md127p1 -L 'Grub (perso)' -l '\EFI\ubuntu\grubx64-perso.efi'
efibootmgr-v
BootOrder: 0000,0001,0002,0003
Boot0000* Grub (perso) HD(1,GPT,44012383-3794-4e23-bb27-840d23cafc70,0x800,0xfa000)/File(\EFI\ubuntu\grubx64-perso.efi)
Boot0001* rEFInd HD(1,GPT,44012383-3794-4e23-bb27-840d23cafc70,0x800,0xfa000)/File(\EFI\refind\refind_x64.efi)
Boot0002* Grub HD(1,GPT,44012383-3794-4e23-bb27-840d23cafc70,0x800,0xfa000)/File(\EFI\ubuntu\grubx64.efi)
生成个性化的 Grub EFI 映像:
sudo grub-mkimage -o /boot/efi/EFI/ubuntu/grubx64-perso.efi --format=x86_64-efi --prefix="(md/RAID_SSD,gpt1)/EFI/ubuntu" mdraid1x luks lvm cryptodisk linux ls cat normal part_gpt fat ext2 reboot gptsync part_gpt part_msdos configfile linuxefi gzio xzio lzopio search search_label search_fs_uuid search_fs_uuid search_fs_file all_video usb usb_keyboard test
当前问题:
尝试升级到较新的系统版本后,Grub 正在更新grub.cfg
文件,但现在此配置已损坏。
它似乎有两个问题:
update-grub
:没有生成正确的grub.cfg
文件- Gurb efi 映像(由 grub-mkimage 个性化):未找到此类加密磁盘
Grub EFI 有效负载ls
:
Grub EFI 有效负载ls (md/RAID_SSD,gpt2)/
:
Grub EFI 有效负载no such cyptodisk found
:
Grub efi 有效负载信息
$ du -h grubx64*
2,5M grubx64.efi
832K grubx64-perso.efi
$ file grubx64*
grubx64.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows, 5 sections
grubx64-perso.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows, 4 sections
与默认值相比,的尺寸grubx64-perso.efi
似乎较小。