将 Grub 从旧 HDD 移至 NVME

将 Grub 从旧 HDD 移至 NVME

我有一个设置,其中我使用 500GB NVME 驱动器和 1TB HDD。两者都有 GPT 分区,但 Grub 与 Windows 10 一起安装在 HDD 中。

我想将其移动到 NVME 驱动器,这样我就不依赖 HDD 来启动我的系统。

Parted 输出

shantanu@shantanu-pc:~$ sudo parted -l
Model: ATA WDC WD10EZEX-08W (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                          Flags
 1      1049kB  316MB   315MB   ntfs            Basic data partition          hidden, diag
 2      316MB   420MB   105MB   fat32           EFI system partition          boot, esp
 3      420MB   555MB   134MB                   Microsoft reserved partition  msftres
 4      555MB   210GB   209GB   ntfs            Basic data partition          msftdata
 5      210GB   524GB   315GB   ntfs            Basic data partition          msftdata
 7      524GB   526GB   2048MB  linux-swap(v1)                                swap
 8      526GB   734GB   208GB   ntfs                                          msftdata
 6      734GB   1000GB  266GB   ntfs            Basic data partition          msftdata


Model: KINGSTON SA2000M8500G (nvme)
Disk /dev/nvme0n1: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system     Name  Flags
 1      1049kB  300GB  300GB   ext4
 3      300GB   483GB  183GB   ext4
 2      483GB   500GB  17.2GB  linux-swap(v1)        swap

efi 位置

shantanu@shantanu-pc:~$ mount | grep boot
/dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

我尝试过:

我尝试安装 grub 并指向我的 nvme 驱动器。但它不起作用,因为/启动/efi安装于/dev/sda2正如我上面所展示的

shantanu@shantanu-pc:~$ sudo grub-install --boot-directory=/boot /dev/nvme0n1
Installing for x86_64-efi platform.
Installation finished. No error reported.
shantanu@shantanu-pc:~$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-46-generic
Found initrd image: /boot/initrd.img-5.15.0-46-generic
Found linux image: /boot/vmlinuz-5.15.0-43-generic
Found initrd image: /boot/initrd.img-5.15.0-43-generic
Found linux image: /boot/vmlinuz-5.15.0-41-generic
Found initrd image: /boot/initrd.img-5.15.0-41-generic
Found linux image: /boot/vmlinuz-5.13.0-52-generic
Found initrd image: /boot/initrd.img-5.13.0-52-generic
Found linux image: /boot/vmlinuz-5.13.0-51-generic
Found initrd image: /boot/initrd.img-5.13.0-51-generic
Found linux image: /boot/vmlinuz-5.13.0-48-generic
Found initrd image: /boot/initrd.img-5.13.0-48-generic
Found linux image: /boot/vmlinuz-5.13.0-44-generic
Found initrd image: /boot/initrd.img-5.13.0-44-generic
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
done

我尝试使用 Ubuntu Live USB 启动并尝试使用启动修复但它不工作,并说分区不是膜生物反应器

我有点卡在这里,任何指导都会有帮助。如果您想查看任何其他命令输出,请告诉我。谢谢阅读。

相关内容