Recovery from an accidental shutdown of Ubuntu (orphan cleanup on readonly fs), ubuntuorphan
The process is as follows:
I was copying a large file. Suddenly the GUI interface of ubuntu was dead and I couldn't call it back, so -- "forced shutdown
After the instance is started again, the screen is black and you cannot access the GUI.
My recovery process is as follows:
1. Press Ctrl + Alt + F1 on the black screen
2. Enter the user name and password to go To the cli interface.
3. View dmesg | less and enter/sda to search for disk information. Find the following information:
[ 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 is my Ubuntu partition. It seems that the copy file was suddenly terminated due to my forced shutdown, and the orphan inode problem occurred. linux automatically restored the file:
4. Check the current mount status and find that the primary partition is 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. Now mount the primary partition to rw using mount-.
peter@DELL-XPS-L502X:/var/log$ sudo mount -a
peter@DELL-XPS-L502X:/var/log$ sync ; sudo reboot -f
After the restart, ubuntu automatically enters the GUI.
Ubuntu/Linux still has a long way to go in the face of human nature. However, it is helpful for technicians to view dmesg in this case.