開機時出現 Error: not read correctly 或 The file /boot/grub/stage1 not read correctly,通常由以下原因導致:
/etc/fstab 或 /etc/mtab 中根分區裝置名稱錯誤 (如 /dev/sda7 變 /dev/sda6)。sudo dd if=ubuntu.iso of=/dev/sdX bs=4M status=progress && sync (或 Rufus/Ventoy/BalenaEtcher)。sudo -i。
# 列出所有分區
lsblk -f
# 或
fdisk -l
# 假設根分區為 /dev/sda7 (ext4)
mkdir -p /mnt/root
mount /dev/sda7 /mnt/root
# 掛載虛擬檔案系統 (chroot 環境必須)
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
mount -o bind /sys /mnt/root/sys
mount -o bind /run /mnt/root/run
# 若有獨立 /boot 分區 (如 /dev/sda6)
mount /dev/sda6 /mnt/root/boot
# 若有獨立 /home、/var 等,同樣掛載對應分區
chroot /mnt/root /bin/bash
source /etc/profile
export PS1="(chroot) $PS1" # 提示符區分
現在你已在目標系統環境中操作,所有命令效果等同於在原系統內執行。
# BIOS/Legacy 模式 (MBR)
grub-install --no-floppy /dev/sda
# 或明確指定
grub-install --target=i386-pc --no-floppy /dev/sda
# UEFI 模式
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu /dev/sda
# --efi-directory: ESP 分區掛載點 (通常 /boot/efi)
# --bootloader-id: NVRAM 啟動項目名稱
若報錯 The file /boot/grub/stage1 not read correctly,進入步驟四。
# 檢查當前掛載情況
cat /proc/mounts
# 對比 /etc/mtab 與 /etc/fstab
cat /etc/mtab
cat /etc/fstab
# 常見問題:/etc/mtab 記錄舊裝置名 (如 /dev/sda7),實際為 /dev/sda6
# 修正 /etc/mtab (符號連結指向 /proc/self/mounts 現代系統無需手改)
# 若為舊系統實體檔案:
vi /etc/mtab
# 將根分區裝置名修正為正確值 (如 /dev/sda6)
# 同步修正 /etc/fstab (永久生效)
vi /etc/fstab
# UUID=xxxx-xxxx / ext4 defaults 0 1 <-- 強烈建議使用 UUID
# 獲取 UUID: blkid /dev/sda6
最佳實務:/etc/fstab 全面改用 UUID 識別分區,免除裝置名稱漂移導致開機失敗。
grub-install --no-floppy /dev/sda
update-grub
# 或 grub-mkconfig -o /boot/grub/grub.cfg
linux /vmlinuz... root=/dev/sda7 或 root=UUID=... 行。root= 參數為正確根分區裝置或 UUID。/boot/grub/grub.cfg (或 /etc/grub.d/ 腳本再 update-grub)。/boot/grub/grub.cfg:自動生成,勿手動編輯。/etc/default/grub:全域參數 (預設啟動項、超時、核心參數、解析度)。/etc/grub.d/:生成腳本 (00_header, 10_linux, 20_linux_xen, 30_os-prober, 40_custom...)。/etc/grub.d/40_custom,執行 update-grub。dd if=/dev/sda of=/backup/grub.mbr bs=512 count=1 (MBR) 或備份 ESP 分區。/etc/fstab、/boot/grub/grub.cfg (透過 /etc/default/grub GRUB_DISABLE_LINUX_UUID=false)。efibootmgr -v),會議 ESP 分區完整性。掌握 Live CD + chroot + GRUB 重裝流程,是 Linux 系統管理員必備的「急救技能」。冷靜分析錯誤訊息、精準掛載分區、修正配置不一致、驗證啟動參數,即可讓無法開機的系統重獲新生。