centos7緊急修復(fù)模式怎么進(jìn)入?
centos7緊急修復(fù)模式怎么進(jìn)入??來看看centos7如何進(jìn)入緊急修復(fù)模式?
打開centos7頁面出現(xiàn):
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
(?? Control-D???):
解決方法:
執(zhí)行 runlevel 顯示unknown
修改默認(rèn)啟動級別
a. 先刪除: mv /etc/systemd/system/default.target /etc/systemd/system/default.target.back #將文件重命名即可
b. 創(chuàng)建軟連接文件: ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
或者
ln -sf /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target
也可以使用systemctl命令:
systemctl set-default graphical.target
systemctl isolate multi-user.target
執(zhí)行過程中報錯:Error getting authority: Error initializing authority: Could not connect: Resource temporarily unavailable (g-io-error-quark, 1)
查看日志 journalctl -xb
發(fā)現(xiàn)日志中掛載出錯:
可以看出是掛載問題,是/home文件沒有掛載上
編輯自動掛載的文件 vi /etc/fstab
把掛載/home的那行注釋掉(先備份)
#/dev/mapper/centos-home /home xfs default 0 0
重啟服務(wù)器 reboot
啟動成功后,頁面卡在白條不動了,可以按esc鍵查看啟動詳情,是在/etc/rc.d/rc.local卡住了,重啟進(jìn)入單用戶模式:
(1).開機時在默認(rèn)項選e
(2).找到ro的那一行
(3)把ro改成 rw init=/sysroot/bin/sh ,按ctrl+x啟動
(4)進(jìn)入單用戶頁面后,要執(zhí)行chroot /sysroot,獲取root權(quán)限
進(jìn)入單用戶模式后編輯rc.local文件,把跟/home有關(guān)的啟動項都注釋掉,重啟服務(wù)器
重啟成功后進(jìn)入正常模式,這時可以查看/home掛載的問題
(1).lvs -a -o +devices查看磁盤詳細(xì)信息,可以看到home的attr參數(shù)沒有a(激活)未激活狀態(tài)
(2).lvchange -a y /dev/mapper/centos-home 激活home
(3).掛載home,mount /dev/mapper/centos-home /home
(4).掛載成功,把原來fstab和rc.local里注釋的在改回去
相關(guān)文章:
1. centos7怎么進(jìn)去tmp目錄并清除垃圾?2. Centos7安裝Chacha20加密算法詳解3. CentOS7.3怎么安裝?使用DVD ISO鏡像安裝CentOS7.3的方法4. CentOS7.0怎么設(shè)置屏幕分辨率?5. centos7使用docker部署gitlab-ce-zh應(yīng)用詳解6. centos7安裝后缺少網(wǎng)卡如何解決?7. centos7如何設(shè)置密碼規(guī)則?centos7設(shè)置密碼規(guī)則的方法8. Centos7安裝完畢后無法聯(lián)網(wǎng)顯示Server not found如何解決?9. CentOS7開啟 BBR為VPS加速詳解10. centos7安裝clickhouse并設(shè)置用戶名密碼案例詳解
