boot-fix/QUICK_REFERENCE.md
2025-08-28 11:17:37 -07:00

1.4 KiB

GRUB Repair Quick Reference

Essential Commands

1. System Detection

sudo ./grub-repair.sh detect
sudo ./grub-repair.sh -d /dev/sda -p 1 -b fix-boot

3. Check Status

sudo ./grub-repair.sh status

4. Clean Up

sudo ./grub-repair.sh clean

Common Scenarios

Fresh Boot Repair

# Detect your system first
sudo ./grub-repair.sh detect

# Then repair (replace /dev/sda with your device)
sudo ./grub-repair.sh -d /dev/sda -p 1 -b fix-boot

GRUB Reinstall Only

# Mount system
sudo ./grub-repair.sh -d /dev/sda -p 1 mount

# Install GRUB
sudo ./grub-repair.sh install-grub

# Update config
sudo ./grub-repair.sh update-grub

# Unmount
sudo ./grub-repair.sh unmount

EFI Partition Check and Repair

sudo ./grub-repair.sh -d /dev/sda check-efi

Device Identification

  • Find your disk: lsblk or fdisk -l
  • EFI partition: Usually the first partition (e.g., /dev/sda1)
  • Root partition: Usually the second partition (e.g., /dev/sda2)

Safety Tips

  • Always use -b flag for backup
  • Test on non-critical systems first
  • Keep live ISO handy for recovery
  • Document your partition layout

Troubleshooting

  • Permission denied: Use sudo
  • Device not found: Check with lsblk
  • Mount fails: Use clean command first
  • Verbose output: Add -v flag