/etc/fstab, /etc/passwd) 修復。fsck)。linux / linux16 / linuxefi 開頭的行 (內核參數行)。single 或 1 或 rd.break (進入 initramfs shell 更早介入)。
mount -o remount,rw /
passwd root 重置密碼)。exit 或 reboot。kernel 行,再按 e。single (或 1),按 Enter。
# LILO 提示符下輸入:
linux single
# 或
linux 1
# 或
linux -s
# 若內核標籤非 linux,按 Tab 列出可用標籤
| 運行級別 | systemd Target | 描述 |
|---|---|---|
| 0 | poweroff.target | 關機 |
| 1 | rescue.target | 單用戶/救援模式 (需 root 密碼) |
| 2,3,4 | multi-user.target | 多用戶文本界面 (無圖形) |
| 5 | graphical.target | 多用戶圖形界面 |
| 6 | reboot.target | 重啟 |
現代系統 single 內核參數實際激活 rescue.target,需輸入 root 密碼;rd.break 在 initramfs 階段打斷,無需密碼但根分區未掛載,需手動掛載 mount /sysroot 並 chroot /sysroot。
# 重置 root 密碼
passwd root
# 修復 /etc/fstab 錯誤
vi /etc/fstab
# 強制文件系統檢查 (下次重啟)
touch /forcefsck
# SELinux 重標記
touch /.autorelabel
# 卸載並修復 XFS/EXT4
umount /dev/sdaX
xfs_repair /dev/sdaX
# 或
fsck -y /dev/sdaX