centos7 出現welcome to emergency mode的解決方法

開機若是遇到不能開機這種事情真的會把人嚇死。一開機就看到這樣的畫面

welcome to emergency mode! after logging in , type “journalctl -xb” to view system logs , “systemctl reboot” to reboot , “systemctl default” to try again to boot into default mode .
give root password for maintenance
(or type Control-D to continue):

但是我用control 跟 D 沒用。
反覆測試發現只能輸入root 密碼來繼續往下執行。

會出這個問題是/etc/fstab的掛載部分出了問題

可以重新掛載的指令

# mount -a  

若是有目錄是唯獨,可以這樣用

# mount -o remount,rw / /

最終的絕招就是,自己修改/etc/fstab,檢查磁碟掛載資訊。註釋掉自己增加的內容,如果確定不使用可以刪除。

最後重開機看看能不能成功開機。