Automated, secure Universal (UEFI & Legacy BIOS) bootloader rescue suite with intelligent Dual-Boot detection, execution speed tracking, and Local In-Situ Repair.
GRUB Fixer (V16 - Ultimate Automation, Legacy BIOS, OS Prober, Universal UEFI & In-Situ Repair) is an automated, bulletproof Bash script designed to repair the GRUB bootloader on both UEFI and Legacy BIOS Linux systems. V16 transforms the script into a true "Universal Rescue Weapon," bringing In-Situ (Local) Repair capabilities, Dynamic 32-bit/64-bit UEFI Detection, a dynamic execution timer with gamer-style human responses, intelligent dual-boot detection (OS Prober), and the powerful Zero-Interaction "Pro Mode" that parses /etc/fstab to map and mount complex layouts (like Btrfs subvolumes) in seconds.
efivarfs) and boot partitions.i386-efi./etc/default/grub to enable GRUB_DISABLE_OS_PROBER=false, ensuring all installed operating systems are detected and listed correctly.i386-pc) Support (V12): The script automatically detects if your system lacks an EFI partition and dynamically switches to Legacy mode.lsblk -no PKNAME to intelligently extract the parent disk from your root partition (e.g., /dev/sda), ensuring flawless GRUB installation on older machines./etc/fstab. It resolves UUID and PARTUUID tags instantly, mapping out your exact system layout (Root, Boot, EFI, and Btrfs subvolumes) without manual input.fstab is missing, encrypted, or rejected, the script gracefully falls back to Smart Auto-Detection (Tier 2), and finally to fully Manual Input (Tier 3), guaranteeing a crash-free experience.@, @home, @log) are mounted in the correct hierarchy with strict input validation./boot vs /boot/efi), which is critical for Archinstall and CachyOS setups.--removable flag to guarantee booting on Virtual Machines (QEMU/KVM) and stubborn UEFI firmware that drop NVRAM variables./var/log/grub-fixer.log for a complete forensic troubleshooting trail.curl | bash pipelines thanks to TTY redirection for all user inputs./etc/os-release from the target system to set the correct Bootloader ID.set -e for immediate halt on errors and automatic umount -R cleanup to prevent mount conflicts.You can choose between the quick one-liner or the manual download method depending on your environment.
Run the script directly from your terminal in any Live Linux environment (or booted broken OS) without downloading. (Note: sudo is required):
curl -sL https://raw.githubusercontent.com/ahmed-x86/grub-fixer/main/grub-fixer.sh | sudo bash
If you prefer to have the file locally or want to audit the code before running:
curl -O https://raw.githubusercontent.com/ahmed-x86/grub-fixer/main/grub-fixer.sh
chmod +x grub-fixer.sh
sudo ./grub-fixer.sh
| Version | Major Changes |
|---|---|
| V1 | Initial manual chroot logic. |
| V2 | Input validation and device checks. |
| V3 | Automatic /mnt cleanup (umount -R). |
| V4 | Failsafe mode, OS detection, and EOF automation. |
| V5 | VM/NVRAM Rescue and TTY Pipeline support. |
| V6 | Smart Auto-Detection & UX Proposal Flow. |
| V7 | Dynamic Custom Volumes Support (The Rescue Update). |
| V8 | Smart EFI Validation, Logging & Root Checks (Smart & Secure Update). |
| V9 | Dynamic Btrfs subvolumes support with smart routing. |
| V10 | Dynamic EFI Mount Logic, Forced Validation Loop, and Improved Auto-Detection. |
| V11 | Zero-Interaction Mode (fstab parser), 3-Tier Fallback System. |
| V12 | Added Legacy BIOS (i386-pc) support, auto-detection, and Target Disk extraction. |
| V13 | Added OS Prober support to automatically detect dual-boot systems (e.g., Windows). |
| V14 | Added Dynamic Execution Timer with gamer-style human responses (The Speedrun Update). |
| V15 | Added Universal UEFI Support (32-bit/i386-efi) with dynamic bitness detection. |
| V16 | Current: Added In-Situ (Local) Mode to repair GRUB directly from the running system without Live USB/chroot. |
x86_64-efi or i386-efi) OR Legacy BIOS (i386-pc).While highly automated, GRUB repair touches critical system files. Always verify the auto-detected partitions, fstab layout, and subvolumes before confirming the repair process, especially on dual-boot systems.