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

參考資料

Donate KJ 贊助作者喝咖啡

如果這篇文章對你有幫助的話,可以透過下面支付方式贊助作者喝咖啡,如果有什麼建議或想說的話可以贊助並留言給我
If this article has been helpful to you, you can support the author by treating them to a coffee through the payment options below. If you have any suggestions or comments, feel free to sponsor and leave a message for me!
方式 Method 贊助 Donate
PayPal https://paypal.me/kejyun
綠界 ECPay https://p.ecpay.com.tw/AC218F1
歐付寶 OPay https://payment.opay.tw/Broadcaster/Donate/BD2BD896029F2155041C8C8FAED3A6F8
All rights reserved,未經允許不得隨意轉載
Built with Hugo
Theme Stack designed by Jimmy