debian修复/dev/mapper/debian vgroot文件错误导致ehcior

本文发布时间: 2019-Mar-22
同事求救, 说重启了一下debian, 系统就挂了.报如下错误```loading, please wait.../dev/mapper/debian--vg-root contains a file system with errors,check the file system./dev/mapper/debian-vg-root:Inodes that were part of a corrupted orphan linked list found./dev/mapper/debian--vg-root: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY....fsck exited with status code 4The root filesystem on /dev/dm-0 requires a manual fsckmodprobe: module ehci-orion not found in modules.depBusyBox v1.22.1 (Debian 1:1.22.0-9+deb8u1) built-in shell(ash)Enter 'help' for a list of built-in commands./bin/sh: can't access tty: job control turned off(initramfs)_```里面的里面是说根节点有文件系统错误, 需要修复. 然后系统自动跑去修复, 修复的是/dev/mapper/debian--vg-root, 修复失败, 模块ehci-orion在内核里面没找到. 所以系统直接进了initramfs系统.这里我们可以分析一下, initramfs是改进版的tmpfs的应用, linux在启动的时候加载内核和 initramfs 到内存执行, 内核初始化之后, 切换到用户态执行 initramfs 的程序/脚本, 加载需要的驱动模块、必要配置等, 然后加载 rootfs 切换到真正的 rootfs 上去执行后续的 init 过程, 比如桌面等等.在修复的时候, 去修复了/dev/mapper/debian--vg-root, 实际这是一个链接, 因为根节点实际没有挂载上, 所以这个链接是无效的. 自然就修复失败.而真实的根节点是挂在/dev/dm-0上的.所以在initramfs里面执行下fsck来修复```fsck.ext4 -y /dev/dm-0```回车就可以自动修复了, 同事的文件系统是ext4, 如果你的是ext3, 就换成fsck.ext3.修复完重启下就可以重新引导和挂载上根文件系统了.可以在initramfs里面执行```cat /proc/cmdline 来查看BOOT的image挂载BOOT_IMAGE=/vmlinuz-3.16.0-4-amd64 root=/dev/mapper/debian--vg-root ro quiet```


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:08pm
栏目列表