1.装了双系统, 找不到ubuntu,只有windows
从windows启动cmd
bcdedit /set “{bootmgr}” path \EFI\ubuntu\grubx64.efi
- 双系统分别装在两块磁盘, windows装在硬盘0, ubuntu装在硬盘1
然后启动是从硬盘0读的boot, 现在我要移除windows硬盘0,然后把boot 改成从硬盘1启动
首先, umount 硬盘0的boot所在的分区, 用lsblk看
umount /dev/nvme0n1p1
然后mount硬盘1, 把硬盘1的/ mount 到/mnt, /boot/efi mount 到/mnt/boot/efi
然后grub-install
mount /dev/nvme1n1p3 /mnt
mount /dev/nvme1n1p1 /mnt/boot/efi
grub-install -d /mnt/usr/lib/grub/x86_64-efi --boot-directory=/mnt/boot /nvme1n1
如果安装失败, 尝试一下下面的mount, 再安装
sudo mount -B /proc /mnt/proc
sudo mount -B /dev /mnt/dev
sudo mount -B /sys /mnt/sys
只要安装成功, 基本上就成功了一大半
我安装完后,还是有问题, 黑屏+自动重启, 然后网上找了一个贴说是nvidia 驱动的问题, 按照的他的步骤设置了一下, 然后再重新grub-install
如果有必要可以试下 sudo update-grub
https://askubuntu.com/questions/3402/how-to-move-boot-and-root-partitions-to-another-drive
https://unix.stackexchange.com/questions/405472/cannot-find-efi-directory-issue-with-grub-install
https://askubuntu.com/questions/1246482/i-got-a-black-screen-every-time-ubuntu-boots-and-i-cant-get-to-the-grub-menu