74 lines
1.4 KiB
Markdown
74 lines
1.4 KiB
Markdown
# GRUB Repair Quick Reference
|
|
|
|
## Essential Commands
|
|
|
|
### 1. System Detection
|
|
```bash
|
|
sudo ./grub-repair.sh detect
|
|
```
|
|
|
|
### 2. Complete Boot Repair (Recommended)
|
|
```bash
|
|
sudo ./grub-repair.sh -d /dev/sda -p 1 -b fix-boot
|
|
```
|
|
|
|
### 3. Check Status
|
|
```bash
|
|
sudo ./grub-repair.sh status
|
|
```
|
|
|
|
### 4. Clean Up
|
|
```bash
|
|
sudo ./grub-repair.sh clean
|
|
```
|
|
|
|
## Common Scenarios
|
|
|
|
### Fresh Boot Repair
|
|
```bash
|
|
# 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
|
|
```bash
|
|
# 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
|
|
```bash
|
|
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
|