在为 Ardor 启动安装第二个 aux Linux 后,我无法将 grub 安装到原来的 kdeneon 上。 (它喜欢其他设置)。
大多数说明都说 sudo grub-install /dev/sda 但是,我没有这些驱动器,并且在 grub-update 之后它不会恢复到原来的状态。
我要输入什么?
lsblk 显示了这一点:
$ lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
nvme0n1
├─nvme0n1p1 vfat ESP 7C8F-092C 23.7M 75% /boot/efi
├─nvme0n1p2
├─nvme0n1p3 ntfs 04106A7F106A7816
├─nvme0n1p4 ntfs Recovery 44CC9028CC901670
├─nvme0n1p5 ext4 749f67cc-2bca-4a9b-bca0-138ba97b6bc7 52.2G 33% /
├─nvme0n1p6 ext4 fc432fe9-2f83-4973-8675-e53dd8de2258
└─nvme0n1p7 ntfs Data 7914628E7BB468B5
sudo efibootmgr -v
[sudo] password for bhante:
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0004,0001,0000,0005,2001,2002,2003
Boot0000* yes PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-26-B7-68-28-F3-73-A5)/HD(1,GPT,82e9aa6b-7b75-49ad-b362-7e51a9085ed9,0x800,0x32000)/File(\EFI\deepin\shimx64.efi)A01 ..
Boot0001* Linpus lite HD(1,GPT,9a1082c8-b452-4c97-9f3f-3a06ad85773a,0x800,0x32000)/File(\EFI\Boot\grubx64.efi)RC
Boot0003* ubuntu HD(1,GPT,9a1082c8-b452-4c97-9f3f-3a06ad85773a,0x800,0x32000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0004* Windows Boot Manager HD(1,GPT,9a1082c8-b452-4c97-9f3f-3a06ad85773a,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0005* neon HD(1,GPT,9a1082c8-b452-4c97-9f3f-3a06ad85773a,0x800,0x32000)/File(\EFI\neon\shimx64.efi)
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC
以下是命令的输出:
bhante@subhuntu:~$ sudo grub-install /dev/nvme0n1
Installing for x86_64-efi platform.
Installation finished. No error reported.
bhante@subhuntu:~$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/99_breeze-grub.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found theme: /boot/grub/themes/breeze/theme.txt
Found linux image: /boot/vmlinuz-5.4.0-65-generic
Found initrd image: /boot/initrd.img-5.4.0-65-generic
Found linux image: /boot/vmlinuz-5.4.0-64-generic
Found initrd image: /boot/initrd.img-5.4.0-64-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Found KDE neon User Edition 5.20 (20.04) on /dev/nvme0n1p6
Warning: Please don't use old title `Neon GNU/Linux (on /dev/nvme0n1p6)' for GRUB_DEFAULT, use `Advanced options for KDE neon User Edition 5.20 (20.04) (on /dev/nvme0n1p6)>Neon GNU/Linux (on /dev/nvme0n1p6)' (for versions before 2.00) or `gnulinux-advanced-fc432fe9-2f83-4973-8675-e53dd8de2258>gnulinux---fc432fe9-2f83-4973-8675-e53dd8de2258' (for 2.00 or later)
Found linux image: /boot/vmlinuz-5.4.0-65-generic
Found initrd image: /boot/initrd.img-5.4.0-65-generic
Found linux image: /boot/vmlinuz-5.4.0-64-generic
Found initrd image: /boot/initrd.img-5.4.0-64-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Found KDE neon User Edition 5.20 (20.04) on /dev/nvme0n1p6
Warning: Please don't use old title `Neon GNU/Linux (on /dev/nvme0n1p6)' for GRUB_DEFAULT, use `Advanced options for KDE neon User Edition 5.20 (20.04) (on /dev/nvme0n1p6)>Neon GNU/Linux (on /dev/nvme0n1p6)' (for versions before 2.00) or `gnulinux-advanced-fc432fe9-2f83-4973-8675-e53dd8de2258>gnulinux---fc432fe9-2f83-4973-8675-e53dd8de2258' (for 2.00 or later)
Found linux image: /boot/vmlinuz-5.4.0-65-generic
Found initrd image: /boot/initrd.img-5.4.0-65-generic
Found linux image: /boot/vmlinuz-5.4.0-64-generic
Found initrd image: /boot/initrd.img-5.4.0-64-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Found KDE neon User Edition 5.20 (20.04) on /dev/nvme0n1p6
Warning: Please don't use old title `Neon GNU/Linux (on /dev/nvme0n1p6)' for GRUB_DEFAULT, use `Advanced options for KDE neon User Edition 5.20 (20.04) (on /dev/nvme0n1p6)>Neon GNU/Linux (on /dev/nvme0n1p6)' (for versions before 2.00) or `gnulinux-advanced-fc432fe9-2f83-4973-8675-e53dd8de2258>gnulinux---fc432fe9-2f83-4973-8675-e53dd8de2258' (for 2.00 or later)
Adding boot menu entry for UEFI Firmware Settings
done
这是 cat /etc/default/grub 的输出 顺便说一句:所有操作都是在 kdeneon 的 linux 引导中完成的,我想将其设置为默认值。
~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT="Neon GNU/Linux (on /dev/nvme0n1p6)"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT="3"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE="640x480"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
GRUB_SAVEDEFAULT="false"
GRUB_THEME="/boot/grub/themes/breeze/theme.txt"
14/2 更新 这是尝试一些建议后 efibootmgr-v 的输出。奇怪的是这是在执行命令之后
sudo efibootmgr -d /dev/nvme0n1 -n 5 -o 0005,0003,0004
所以我不确定发生了什么。
bhante@subhuntu:~$ sudo efibootmgr -v
[sudo] password for bhante:
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0002,0003,0004,0005,0001,2001,2002,2003
Boot0000* yes PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-26-B7-68-28-F3-73-A5)/HD(1,GPT,82e9aa6b-7b75-49ad-b362-7e51a9085ed9,0x800,0x32000)/File(\EFI\deepin\shimx64.efi)A01 ..
Boot0001* yes PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-26-B7-68-28-F3-73-A5)/HD(1,GPT,82e9aa6b-7b75-49ad-b362-7e51a9085ed9,0x800,0x32000)/File(\EFI\deepin\shimx64.efi)A01 ..
Boot0002* Linpus lite HD(1,GPT,9a1082c8-b452-4c97-9f3f-3a06ad85773a,0x800,0x32000)/File(\EFI\Boot\grubx64.efi)RC
Boot0003* ubuntu HD(1,GPT,9a1082c8-b452-4c97-9f3f-3a06ad85773a,0x800,0x32000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0004* Windows Boot Manager HD(1,GPT,9a1082c8-b452-4c97-9f3f-3a06ad85773a,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0005* neon HD(1,GPT,9a1082c8-b452-4c97-9f3f-3a06ad85773a,0x800,0x32000)/File(\EFI\neon\shimx64.efi)
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC
这与我之前运行的输出相同。
bhante@subhuntu:~$ sudo efibootmgr -d /dev/nvme0n1 -n 5 -o 0005,0003,0004
BootNext: 0005
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0005,0003,0004
Boot0000* yes
Boot0001* yes
Boot0002* Linpus lite
Boot0003* ubuntu
Boot0004* Windows Boot Manager
Boot0005* neon
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network
答案1
您当前使用 Boot0003 中的 grub2 efi 可执行文件启动,并且希望使用 Neon (Boot0005) 中的可执行文件启动,如果我理解正确的话?
然后运行: sudo efibootmgr -d /dev/nvme0n1 -n 5
选择下次启动进入neon启动管理器。
目前,引导顺序默认引导至 Ubuntu 的 grub2 efi 可执行文件。您可以使用(等)作为 efibootmgr 的参数来更改引导顺序-o 0005,0003,0004
。
这grub2-install
并不能真正帮助您,您正在阅读的文档可能早于 UEFI。您只需要告诉您的固件启动适当系统的消防条目即可。
答案2
您的驱动器是 NVMe 驱动器 /dev/nvme0n1。
因此,如果启动到您希望作为默认启动的安装。
sudo grub-install /dev/nvme0n1
也可以看看:
man grub-install
默认值应该可以使用,但 UEFI 安装时有很多选项。您确实需要在 fstab 中安装正确的 ESP。您可以通过以下方式确认:
cat /etc/fstab
您还可以检查 UEFI 启动条目。
sudo efibootmgr -v
如果您想清理旧条目。确保仅删除过时的条目。
https://askubuntu.com/questions/1198221/cloning-ssd-also-cloned-boot-options/1198228#1198228
如果无法启动到所需的安装,通常需要 chroot 进入安装以挂载所需的分区。对于新用户来说,通常更容易从实时安装程序中使用引导修复。
https://help.ubuntu.com/community/Boot-Repair
UEFI 根目录:
要更改引导顺序,请使用 efibootmgr 及其 -o 选项来更改顺序。
https://askubuntu.com/questions/485261/change-boot-order-using-efibootmgr