Featured image of post Welcome to emergency mode on Ubuntu 16.04,无法正确 mount 硬碟

Welcome to emergency mode on Ubuntu 16.04,无法正确 mount 硬碟

在 Ubuntu 开机时画面显示 After logging in, type "journalctl -xb" to view system log,无法正确 mount 硬碟

Ubuntu 16.04 一开机时,突然出现了下面的讯息,再次重新开机也没用一样卡住无限鬼打牆

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 boot into default mode. Give root password for maintained (or press Control-D to continue).

输入 root 密码登入打入 journalctl -xb 检查开机讯息时,发现在 mount 硬碟时整个卡住,导致系统无法顺利启动

这个错误讯息常发生在载入 外部硬碟网路硬碟 等没有载入导致

解决方式

emergency mode 登入 root 帐号后输入下列指令让 /etc/fstab 档案有被写入的权限

$ mount -n -o remount,rw /

/etc/fstab 是自动 mount 的设定档案,使用 vivim 编辑此档案

$ sudo vim /etc/fstab

/etc/fstab 档案中将卡住的 mount 硬碟输入 # 註解掉

# 註解前
UUID=bcb03e9a-fa15-4a6d-a8ea-ac2c8180654d /data           ext4    errors=remount-ro 0      0

# 註解后
# 这一行挂载出现问题,在前方加入註解取消挂载
# UUID=bcb03e9a-fa15-4a6d-a8ea-ac2c8180654d /data           ext4    errors=remount-ro 0      0

註解挂载指令后 /etc/fstab 档案会长的像这样

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=4fb9f563-7ae4-4df9-a028-fdc6b9e4f1a5 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda3 during installation
UUID=cf0cf85a-6fed-4c43-901d-c946d6e1c5fa none            swap    sw              0       0
# 这一行挂载出现问题,在前方加入註解取消挂载
# UUID=bcb03e9a-fa15-4a6d-a8ea-ac2c8180654d /data           ext4    errors=remount-ro 0      0

输入指令切换成预设模式

$ systemctl default

重新开机后就可以正常进入系统了

systemctl reboot

参考资料

comments powered by Disqus
All rights reserved,未經允許不得隨意轉載
Built with Hugo
主题 StackJimmy 设计