本文內容與 ID 45918 高度重疊,此處提供精簡指令卡片,適合快速查閱。完整解析請參考 ID 45918。
| 問題 | 核心指令 | 關鍵檔案/路徑 |
|---|---|---|
| 取得 Root (單用戶) | GRUB → Advanced → recovery mode → root → mount -o remount,rw / | /etc/fstab, /boot/grub/grub.cfg |
| 取得 Root (Live USB) | mount /dev/sda2 /mnt; mount /dev/sda1 /mnt/boot/efi; for d in dev proc sys; do mount --bind /$d /mnt/$d; done; chroot /mnt | /dev/sda2 (根), /dev/sda1 (EFI) |
| 修改 Kernel 參數單次啟動 | GRUB → e → rw init=/bin/bash → Ctrl+x | /boot/grub/grub.cfg |
| 重設密碼 | passwd root / passwd user | /etc/shadow |
| 重設 GRUB 密碼 | grub-mkpasswd-pbkdf2 → /etc/grub.d/40_custom → update-grub | /boot/grub/grub.cfg |
| Windows 覆寫 GRUB 修復 | Live USB chroot → grub-install /dev/sda; update-grub (BIOS) / grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu; update-grub (UEFI) | /boot/efi, /boot/grub |
| Windows 讀 Linux 分區 | WSL2: wsl --mount \\.\PHYSICALDRIVE2 --partition 1 --type ext4 | Linux Reader, Ext2Fsd (舊) |
| 開機慢 (systemd 分析) | systemd-analyze blame; systemd-analyze critical-chain | /etc/systemd/system/*.service |
| 停用慢速服務 | systemctl disable ntpdate snapd.seeded plymouth-quit-wait | /etc/systemd/system/ |
| 雙系統時間差 (UTC/Local) | timedatectl set-local-rtc 1 --adjust-system-clock | /etc/adjtime |
| 瀏覽器/音訊無聲 | systemctl --user restart pipewire pipewire-pulse wireplumber; pavucontrol | ~/.config/pulse/, /etc/pipewire/ |
| 強制清空垃圾桶 | rm -rf ~/.local/share/Trash/{files,info}/* | ~/.local/share/Trash/ |
| 檔案系統修復 | fsck -f /dev/sda2 (卸載狀態) | /etc/fstab |
| 套件修復 | dpkg --configure -a && apt -f install | /var/lib/dpkg/ |
| initramfs 重建 | update-initramfs -u -k all | /boot/initrd.img-* |
| Locale 亂碼修復 | locale-gen zh_TW.UTF-8 && update-locale LANG=zh_TW.UTF-8 | /etc/locale.gen, /etc/default/locale |
systemd-timesyncd / chronydip addr/route/linknmcli / nmtui / systemd-networkdsystemctl start/stop/restart/enable/disablegrub-install --target=x86_64-efi ... (UEFI 標準)# 安裝
apt install timeshift
# 或 Flatpak
flatpak install flathub com.teejeetech.Timeshift
# 建立快照 (GUI 或 CLI)
timeshift --create --comments "Pre-update" --tags D
# 還原 (需 Live USB/Recovery 模式)
timeshift --restore --snapshot '2024-01-15_10-30-00' --target /dev/sda2
建議:變更前快照、問題時還原、日誌留證、知識入庫。