Ubuntu22.04 将EFI启动分区迁移到另一块硬盘

机器上有两块硬盘, 一块已经安装了Win10, 另一块新装Ubuntu22.04, 在新硬盘上划分分区的时候, 有分出256M给 BOOT EFI, 但是安装的时候没注意, 启动分区不知道怎的跑到 Windows 所在的硬盘上了

记录一下将 /boot/efi 分区迁移至 Ubuntu 所在硬盘, 并创建 Grub 的记录.

预留的 boot efi 分区为 /sdb/sdb1

  1. 找到 sdb1 的 UUID
sudo blkid | grep /dev/sdb1
  1. 在 /etc/fstab 中, 将 /boot/efi 的 UUID 修改为刚才获得的 UUID 值
sudo nano /etc/fstab
  1. 从系统中卸载 /boot/efi, 再重新mount
sudo umount /boot/efi && sudo mount /boot/efi
  1. 检查一下, 确认 mount 的硬盘分区是对的
lsblk | grep /boot/efi
  1. 在 sdb (硬盘, 不是分区) 上安装 grub
sudo grub-install /dev/sdb
  1. 生成 initramfs image
sudo update-initramfs -u -k all
  1. 生成 grub2 config 文件
sudo update-grub

之后重启, 确认 /boot/efi 挂载的是 sdb1

lsblk | grep /boot/efi

链接

https://askubuntu.com/questions/1250199/move-bootloader-or-remove-efi-partition-in-second-drive

猜你喜欢

转载自blog.csdn.net/michaelchain/article/details/130660081