我有一台工作站,最初安装时使用的是 zsys 的 20.04 版本,后来升级到了 22.04 版本。我从 4 月份开始使用它,没有出现任何问题,但昨天一个软件锁定了机器,并以某种方式搞乱了 GRUB。我能够使用实时映像和 GRUB 命令行启动机器,但不知何故,每当我运行 时,update-grub
GRUB 菜单中添加的唯一内容就是"UEFI Firmware Settings"
。我没有更改任何 grub 或内核设置或软件包,也没有更改任何 ZFS 设置。
输出自update-grub
:
root@voyager:/home/jamie# !upd
update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@lfs-init
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@lfs-init
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@lfs-init
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@lfs-init
Found linux image: vmlinuz-5.13.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@pre-jammy-upgrade
Found initrd image: initrd.img-5.13.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@pre-jammy-upgrade
Found linux image: vmlinuz-5.13.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@pre-jammy-upgrade
Found initrd image: initrd.img-5.13.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@pre-jammy-upgrade
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@upgrade
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@upgrade
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@upgrade
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@upgrade
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-40-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found linux image: vmlinuz-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Found initrd image: initrd.img-5.15.0-39-generic in rpool/ROOT/ubuntu_XXXXXX@autozsys_XXXXXX
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
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 ...
done
我已经尝试了我能想到的所有正常系统恢复方法,但我完全不明白为什么 grub 不再添加启动项grub.cfg
......就好像它bpool
完全忽略了一样。
有人能对此提供任何见解或者我应该尝试什么吗?
答案1
对我来说,问题是 22.04.2LTS 安装程序在正确的磁盘上创建了 EFI 启动分区,但随后在文件中写入了错误的分区/etc/fstab
。
解决方案很简单:
- 在某处挂载正确的 EFI 分区(例如
/mnt/efi/
) grub.cfg
通过运行在正确的位置创建grub-mkconfig -o /mnt/efi/grub/grub.cfg
- 编辑
/etc/fstab
并替换 EFI 启动分区(通常安装在/boot/efi
) - 重启