Automated, secure Universal (UEFI & Legacy BIOS) bootloader rescue suite with absolute Trap Safety, Modular Architecture, Backend API capabilities, Security Hardening, Secure Boot MOK Enrollment, LUKS Encryption Support, and Deep Scan Intelligence.
GRUB Fixer (V27 - The "Bulletproof" Update) takes system recovery to the absolute limit. It is an automated, bulletproof Bash script designed to repair the GRUB bootloader on both UEFI and Legacy BIOS GNU/Linux systems. V27 solidifies the engine with extreme error handling, strict cleanup traps, and absolute execution safety. This builds upon the Modular Architecture (V26), VM Polishing (V25), Backend API (V24), Security Hardening (V23), Secure Boot Support (V22), and LUKS Encryption (V21) of previous versions.
trap engine to automatically unmount and clean up the system on errors, plus global input validation and download integrity verification.
trap system guarantees that your system is never left in an unstable state, safely unmounting all partitions before exiting on success, failure, or interruption.y/n answers across all interactive prompts, eliminating typos.fstab parsing.--sys-info, --json-scan).--map-std or --map-btrfs.read -s)./etc/default/grub before modification.mokutil --sb-state to check if Secure Boot is enforced.--uefi-secure-boot on Debian/Ubuntu systems to utilize Microsoft-signed shim binaries.sbctl Integration: Detects custom keys and attempts automatic sbctl sign.crypto_LUKS partitions before the Deep Scan Engine starts.vgchange -ay to expose hidden Logical Volumes.GRUB_ENABLE_CRYPTODISK=y to ensure the repaired system prompts for a password.grub, os-prober, efibootmgr, cryptsetup, mokutil).pacman, apt-get, dnf, or zypper.grub2-install / grub2-mkconfig.Bypass prompts, enable headless automation, or integrate with graphical frontends:
--sys-info: Return basic system information as JSON.--json-scan: Stealth scan outputting partition layout as JSON.--map-std "<mapping>": Explicit partition layout for standard filesystems.--map-btrfs "<mapping>": Explicit partition layout for Btrfs setups.-env l or -env live: Force the script to assume a Live Environment.-env h or -env host: Force the script to assume a Real Machine environment.-auto: Bypasses all confirmation prompts (y/n) and executes the repair instantly.--version or -v: Print the current version and exit.Run the "Ultimate Rescue Weapon" directly from your terminal:
The classic, smart, and unified interactive experience:
curl -sL https://raw.githubusercontent.com/ahmed-x86/grub-fixer/main/grub-fixer.sh | sudo bash
Skip all questions and let the script fix GRUB silently based on auto-detection (perfect for Live USBs):
curl -sL https://raw.githubusercontent.com/ahmed-x86/grub-fixer/main/grub-fixer.sh | sudo bash -s -- -env l -auto
curl -O https://raw.githubusercontent.com/ahmed-x86/grub-fixer/main/grub-fixer.sh
chmod +x grub-fixer.sh
sudo ./grub-fixer.sh [FLAGS]
| Version | Major Changes |
|---|---|
| V1 | Basic manual-like chroot logic for GRUB repair. |
| V2 | Added input validation (checks if partition exists) and loops for user input. |
| V3 | Added /mnt cleanup (umount -R) before starting to prevent mount conflicts. |
| V4 | Added 'set -e' for safety, forced Root partition input, OS detection. |
| V5 | Added '--removable' to fix VM/NVRAM issues, and TTY Pipeline support. |
| V6 | Added Auto-Detection using lsblk FSTYPE without mounting. |
| V7 | Added dynamic support for mounting custom volumes (e.g., /home, /var). |
| V8 | Added Root Validation, System Logging, and Smart EFI Detection. |
| V9 | Added dynamic Btrfs subvolumes support with smart routing. |
| V10 | Bulletproof Btrfs loop (forced y/n), fixed Archinstall /boot vs /boot/efi trap. |
| 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 | Added In-Situ (Local) Mode to repair GRUB directly from the running system without Live USB/chroot. |
| V17 | Deep Scan Engine, Kernel Cmdline Detection, & Unified UX Prompt. |
| V18 | Added CLI Flags (--version, -env l/h, -auto) for complete Zero-Interaction Automation. |
| V19 | Added universal support for RedHat/Fedora/CentOS family (dynamic grub2 commands & paths). |
| V20 | Chroot Health Check - Auto-detects and installs missing GRUB/EFI packages with DNS resolv support. |
| V21 | LUKS & LVM Encryption Support - Auto-detects, unlocks (visible password), and configures GRUB_ENABLE_CRYPTODISK. |
| V22 | Secure Boot & Shim Integration - Auto-detects Secure Boot, handles shim-signed, and MOK Enrollment. |
| V23 | Security Hardening & Bug Fixes - Dynamic MOK OTP, hidden LUKS passwords, config backups, and environment isolation. |
| V24 | The "Backend API" Update - Added JSON Endpoints (--sys-info, --json-scan) and explicit mapping for GUI integration. |
| V25 | The "Polishing" Update - VM/VirtIO Regex Fallback and Btrfs Hardening. |
| V26 | The "Modular" Update - Completely refactored the monolith script into a modular architecture with on-the-fly loading. |
| V27 | Current: The "Bulletproof" Update - Strict trap cleanup engine, download integrity verification, and global input validation. |