Emergency mode Ubuntu 16.10Опубликовано сб, 10/06/2018 - 22:20 пользователем Nikolai
I have the Ubuntu 16.04 that was updated to 16.10.
And one day I faced with the following situation on the preload ubuntu screen
/dev/sda6: recovering journal
/dev/sda6: clean, 193225/9527296 files, 1610280/38077184 blocks
Welcome to emergency mode! After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or ^D to
try again to boot into default mode.
Press Enter for maintenance
(or press Control-D to continue):
1. The first reason is the error turned out that an external disk connected via USB was registered in /etc/fstab, which was unmounted manually and disconnected from the server without restarting the computer, forgetting to remove its mention from /etc/fstab.
journalctl -xb | grep failed
In the output, I saw a message that I could not mount the removable disk. I went to /etc/fstab and commented out the line related to the external disk:
nano /etc/fstab # after opening the editor commented out the line related to the external HDD
shutdown -r now # restart system
What if there is nothing superfluous in /etc/fstab?
Precondition: go to the BIOS (F2 for Lenovo laptop) to enable the USB mode
1. Boot from LiveCD or LiveUSB. (See the steps how to create the liveUSB flash on Mac OS X https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-macos)
2. Open a terminal (Ctrl + Alt + T), expand it to full screen (F11).
3. Become root: sudo su -
4. Print all available partitions: fdisk -l If you have managed to mount partitions related to hard drives (for ubuntu it should be disks with ext4 partition), then you need to unmount them: umount /dev/sda1 I think the principle is clear.
5. Check file system for partitions, bind to hard drives: fsck -y /dev/sda1 The -y flag, which, if necessary, you need to try to restore in automatic mode.
Note: if the fsck -y failed with the error: 'e2fsck: Get a newer version of e2fsck!', try to perform the followtin steps under sudo su -
tar xzf e2fsprogs-1.43.1.tar.gz
./configure # <== if this step fail, check the config.log file, it could just be that you are missing the "libc6-dev" package on your system
./e2fsck -y /dev/sda1 <== run this step for all ubuntu system disks (with partition ext4)
After that, you can safely restart the computer and start from your main disk - everything should work like clockwork.