1、背景介绍
目前X86平台采用湖南麒麟3.3-3B系统,当遇到文件系统损坏时,可分下面两种情况进行文件系统修复
2、紧急模式下的修复
板子能进入系统,但是进入的是紧急模式,类似下面这种
![](https://file.jishuzhan.net/article/1705556964936781825/d4b35ece5e627e3b66304e2d0be598fb.webp)
![](https://file.jishuzhan.net/article/1705556964936781825/de160b235580f994ff1e760a7b1505f3.webp)
此时可以直接输入修复命令进行系统修复
bash
xfs_repair -L /dev/mapper/kylin-root
3、单用户模式下的修复
单用户模式是无法进入系统,类似下面这样
此时需要进入单用户模式,在系统选择界面按e,编辑grub引导参数
![](https://file.jishuzhan.net/article/1705556964936781825/bac14d5bb6f1ef647e4cc2a99359601a.webp)
![](https://file.jishuzhan.net/article/1705556964936781825/c3b17616fe894713095bd788b9bb2175.webp)
按ctrl+x进入单用户模式
![](https://file.jishuzhan.net/article/1705556964936781825/7b2cc5bf77f59d333885a55a48dfe7c8.webp)
此时可以先卸载root分区,然后再进行修复
bash
umount /dev/mapper/kylin-root
/usr/sbin/xfs_repair -L /dev/mapper/kylin-root -d
![](https://file.jishuzhan.net/article/1705556964936781825/873ddf9239782c96f31d1334d31339ca.webp)
![](https://file.jishuzhan.net/article/1705556964936781825/05eceb0fdf87474d886897766683b8bc.webp)
修复后会有打印
![](https://file.jishuzhan.net/article/1705556964936781825/75f994e516a71cbd4834760ede78c5f3.webp)
以上两种方式修复后断电重启即可