![在 Windows 双启动中找不到 Ubuntu](https://linux22.com/image/920294/%E5%9C%A8%20Windows%20%E5%8F%8C%E5%90%AF%E5%8A%A8%E4%B8%AD%E6%89%BE%E4%B8%8D%E5%88%B0%20Ubuntu.png)
虽然这似乎是一个多余的问题,但我已经尝试了在这里找到的所有答案,但没有一个适合我的情况:
我有一台预装了 Windows 10 的新 HP 笔记本电脑。我使用 Windows diskmgmt 创建了未分配空间,并使用“同时安装”选项安装了 Ubuntu 18.04。现在我找不到启动 Ubuntu 的方法。
我已禁用传统启动并启用安全启动,更改此设置没有任何区别。在 UEFI 启动顺序选项中,没有 Ubuntu 选项,我无法进入 grub。我尝试bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
在 Windows 中操作,但没有成功。然后我尝试使用 Live USB(我需要nomodeset
)选项中的 Ubuntu 来运行boot-repair
,但这也不起作用。然后我尝试使用中介绍的方法重新安装 grubhttps://help.ubuntu.com/community/Grub2/Installing在“通过 LiveCD 终端”下。但是在这里我不确定要使用哪些磁盘和分区,因为我的磁盘标记为/dev/nvme...
而不是/dev/sd...
。这是我的fdisk -l
输出:
Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5429963C-036C-4BFB-8C0D-B713D1867C29
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 534527 532480 260M EFI System
/dev/nvme0n1p2 534528 567295 32768 16M Microsoft reserved
/dev/nvme0n1p3 567296 589567999 589000704 280.9G Microsoft basic data
/dev/nvme0n1p4 999168000 1000198143 1030144 503M Windows recovery environment
/dev/nvme0n1p5 589568000 999167609 409599610 195.3G Linux filesystem
然后使用
sudo mount /dev/nvme0n1p5 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/nvme0n1
出现了以下错误:
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.
我希望这是所有相关信息,并且我真的很感激一些关于我还可以尝试什么的指点,谢谢。
编辑:
一开始我关闭了 Windows 中的休眠功能。另一种建议的安装 grub 的方法导致出现以下情况,之后我仍然找不到 Ubuntu 或 grub。
ubuntu@ubuntu:~$ sudo mount /dev/nvme0n1p5 /mnt
ubuntu@ubuntu:~$ sudo mount /dev/nvme0n1p1 /mnt/boot/efi
ubuntu@ubuntu:~$ for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# grub-install /dev/nvme0n1
Installing for x86_64-efi platform.
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT:Alternate GPT header not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT: Use GNU Parted to correct GPT errors.
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT:Alternate GPT header not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT: Use GNU Parted to correct GPT errors.
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT:Alternate GPT header not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT: Use GNU Parted to correct GPT errors.
Installation finished. No error reported.
root@ubuntu:/# update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.0.0-23-generic
Found initrd image: /boot/initrd.img-5.0.0-23-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
ubuntu@ubuntu:~$ sudo mount /dev/nvme0n1p5 /mnt
ubuntu@ubuntu:~$ sudo mount /dev/nvme0n1p1 /mnt/boot/efi
ubuntu@ubuntu:~$ for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# grub-install /dev/nvme0n1
Installing for x86_64-efi platform.
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT:Alternate GPT header not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT: Use GNU Parted to correct GPT errors.
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT:Alternate GPT header not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT: Use GNU Parted to correct GPT errors.
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT:Alternate GPT header not at the end of the disk.
GPT:0x3b9e00ef != 0x3b9e12af
GPT: Use GNU Parted to correct GPT errors.
Installation finished. No error reported.
root@ubuntu:/# update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.0.0-23-generic
Found initrd image: /boot/initrd.img-5.0.0-23-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
编辑:它现在可以工作了,也许另一次重新启动起了作用,或者有一些自动的 gparted 魔法。