首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何修复CentOS?未能挂载/sysroot

如何修复CentOS?未能挂载/sysroot
EN

Unix & Linux用户
提问于 2017-01-14 03:26:07
回答 4查看 101.5K关注 0票数 15

我已经在我的机器上安装了centOS 7,在过去的4到5个月里我一直在使用它,它运转良好。但几天前,由于断电(不恰当的关闭),我的机器发生了一些不好的事情。现在,当我启动系统时,它会在开始时给我这个消息。

代码语言:javascript
运行
复制
XFS (dm-0): Internal error XFS_WAIT_CORRUPTED at line 1600 of file fs/xfs/libxfs/xfs_alloc.c. Caller xfs_free_extent+0xf9/0x130 [xfs]
XFS (dm-0): Failed to recover EFIs

带有结束错误消息

代码语言:javascript
运行
复制
...
Mounting /sysroot...
[  ***] A start job is running for /sysroot (3min 59s / 4min 31s)[240.527013] INFO: task mount:406 blocked for more than 120 seconds.
[  240.527056] "echo 0 > /proc/sys/kernel/hung_task_timeout+secs" disables this message."
[FAILED] Failed to mount /sysroot.
See 'systemctl status sysroot.mount' for more details.
[DEPEND] Dependency failed for Initrd Root File System.
[DEPEND] Dependency failed for Reload Configration from the Real Root.
[  OK  ] Stopped dracut pre-pivot and cleanup hook.
[  OK  ] Stopped target Initrd Default Target.
[  OK  ] Reached target Initrd File System.
[  OK  ] Stopped dracut mount hook.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped System Initialization.
         Starting Emergency Shell...

Genrating "/run/initramfs/rdsosreport.txt"

Entering emergancy mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to usb stick or /boot
after mounting them and attach it to a bug report.

:/#

这个问题是可以解决的

  1. 修复此错误(损坏的文件)。
  2. 重新安装(修理)整个操作系统。就像我们平时在窗户里做的一样。

请指导如何做上述任何一个来解决我的问题。

注意:如果有其他方法重新安装OS而不丢失旧数据,请告诉我。

编辑:1我使用live-cd运行xfs_repair,输出是

代码语言:javascript
运行
复制
sudo xfs_repair -v /dev/dm-0

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Phase 1 - find and verify superblock...
superblock read failed, offset 0, size 524288, ag 0, rval -1

fatal error -- Input/output error
EN

回答 4

Unix & Linux用户

发布于 2017-05-10 00:25:48

在我的例子中,下面的命令起了作用。

代码语言:javascript
运行
复制
sudo xfs_repair -v -L /dev/dm-0

电源中断后,我的节点未能启动,并得到了“未能装入/sysroot”的错误,并进入了紧急模式。

挂载和卸载失败了,所以继续使用-L选项运行,这再次帮助我的节点启动。

票数 36
EN

Unix & Linux用户

发布于 2017-01-14 16:55:40

听起来你需要运行XFS修理。断电一定使文件系统处于糟糕的状态。

票数 3
EN

Unix & Linux用户

发布于 2017-04-13 16:07:07

你可以做一些XFS的修复..。

你应该运行xfs_repair吗?因为如果挂载失败并且日志包含脏日志,那么xfs_repair就不会运行,所以我们被迫使用(-L)选项,但是它的描述说(-L)会破坏文件系统。

如果xfs安装成功,即使在这种情况下访问某些文件也会导致IO输入/输出错误。

它为xfs_repair推荐了以下用法,以便您不会遇到以下问题:成功挂载、->、->、运行xfs_repair ->挂载失败->、xfs_repair -> xfs_repair失败->最后xfs_repair -L ->挂载

添加上述挂载+ xfs_repair过程使文件系统稳定

票数 2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/337289

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档