首页 > 代码库 > Ubuntu一次意外关机的恢复(orphan cleanup on readonly fs)

Ubuntu一次意外关机的恢复(orphan cleanup on readonly fs)

事情的经过是这样的:

我在拷贝一个大文件是,突然ubuntu的GUI界面卡死,怎么换都唤不回来,于是--》强行关机了

然后再次开机,就一直黑屏,无法进入到GUI界面。

我的恢复过程如下:

1. 在黑屏下按 Ctrl+Alt+F1

2. 输入用户名,密码,进入cli界面

3. 查看dmesg | less 然后输入 /sda  查找磁盘相关信息,找到如下信息:

[    3.746177] EXT4-fs (sda3): INFO: recovery required on readonly filesystem[    3.746181] EXT4-fs (sda3): write access will be enabled during recovery[    3.929572] random: nonblocking pool is initialized[    5.484289] EXT4-fs (sda3): orphan cleanup on readonly fs[    5.484354] EXT4-fs (sda3): 5 orphan inodes deleted[    5.484356] EXT4-fs (sda3): recovery complete[    5.565464] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)

sda3 是我的Ubuntu分区,看来是我刚才的强行关机造成 拷贝文件突然终止,出现 orphan inode问题,linux进行了自动恢复:

4. 查看当前mount情况,发现主分区是read-only的:

peter@DELL-XPS-L502X:/var/log$ man mountpeter@DELL-XPS-L502X:/var/log$ mount/dev/sda3 on / type ext4 (ro,errors=remount-ro)proc on /proc type proc (rw,noexec,nosuid,nodev)sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)none on /sys/fs/cgroup type tmpfs (rw)none on /sys/fs/fuse/connections type fusectl (rw)none on /sys/kernel/debug type debugfs (rw)none on /sys/kernel/security type securityfs (rw)udev on /dev type devtmpfs (rw,mode=0755)

5. 现在使用mount -a把主分区mount为rw

peter@DELL-XPS-L502X:/var/log$ sudo mount -a
peter@DELL-XPS-L502X:/var/log$ sync ; sudo reboot -f

重启后,ubuntu会自动进入到GUI界面

Ubuntu/Linux在人性化发面还有很长的路要走,不过,对于技术人来说,遇到这种情况,查看dmesg是很有帮助的

 

Ubuntu一次意外关机的恢复(orphan cleanup on readonly fs)