环境:Windows + ArchLinux 双系统
背景:Windows C盘容量不太够用了,于是睡觉前扩容了一下C盘,第二天上完课回宿舍发现引导寄了。
error: unknown filesystem
Entering rescue mode...
解决问题
因为装了太久了,忘了Linux装哪个分区了,所以要先找到Linux所在分区
先输入指令set看一下引导配置
grub rescue> set
cmdpath='(hd1,gpt1)/EFI/ARCH'
prefix='(hd1,gpt9)/@/boot/grub'
root='hd1,gpt9'
再输入指令ls查询分区情况
grub rescue> ls
(hd0) (hd0,gpt1) (hd1) (hd1,gpt9) (hd1) (hd1,gpt8) (hd1) (hd1,gpt7) (hd1) (hd1,gpt6) (hd1) (hd1,gpt5) (hd1) (hd1,gpt4) (hd1) (hd1,gpt3) (hd1) (hd1,gpt2) (hd1) (hd1,gpt1)
根据输出的分区挨个试一下
grub rescue> ls (hd0,gpt1)
(hd0,gpt1):Filesystem is unknown.
grub rescue> ls (hd1,gpt1)
(hd0,gpt1):Filesystem is unknown.
grub rescue> ls (hd1,gpt2)
(hd0,gpt1):Filesystem is unknown.
grub rescue> ls (hd1,gpt3)
(hd0,gpt1):Filesystem is unknown.
grub rescue> ls (hd1,gpt4)
(hd0,gpt1):Filesystem is unknown.
grub rescue> ls (hd1,gpt5)
(hd0,gpt1):Filesystem is unknown.
grub rescue> ls (hd1,gpt6)
(hd0,gpt1):Filesystem is unknown.
grub rescue> ls (hd1,gpt7)
(hd0,gpt1):Filesystem is btrfs.
grub rescue> ls (hd1,gpt8)
(hd0,gpt1):Filesystem is unknown.
grub rescue> ls (hd1,gpt9)
(hd0,gpt1):Filesystem is unknown.
可以看见只有hd1硬盘中的gpt7分区可以识别,格式为btrfs,正是Linux所在盘的格式
所以现在把引导改成gpt7分区就行了
set prefix=(hd1,gpt7)/@/boot/grub
set root=hd1,gpt7
然后加载正常模式并且启动,没有报错的话就可以进入引导界面了
insmod normal
normal
再进入ArchLinux彻底解决问题
lsblk #查看Linux所在分区
sudo grub-install /dev/nvme1n1p7 #重新设置引导
sudo grub-mkconfig -o /boot/grub/grub.cfg #更新配置