Ahmed x86 - GRUB Fixer 🛠️

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.

Version V27 Bash GNU/Linux Zero Interaction Ready UEFI & BIOS Support Bulletproof Safety

About the Project

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.

✨ New in V27: Absolute Safety! Implemented a strict trap engine to automatically unmount and clean up the system on errors, plus global input validation and download integrity verification.

🛡️ The Bulletproof Update (V27)

🧩 The Modular Update (V26)

✨ The Polishing Update (V25)

🔌 The Backend API Update (V24)

🔒 The Security Hardening Update (V23)

🛡️ The Secure Boot Update (V22)

🔐 The LUKS Encryption Update (V21)

🩺 The Health Check Update (V20)

🌐 The Universal Update (V19)

🚩 CLI Flags & API Reference

Bypass prompts, enable headless automation, or integrate with graphical frontends:


🛠️ Usage

Run the "Ultimate Rescue Weapon" directly from your terminal:

Option 1: Quick One-Liner (Interactive Mode)

The classic, smart, and unified interactive experience:

curl -sL https://raw.githubusercontent.com/ahmed-x86/grub-fixer/main/grub-fixer.sh | sudo bash

Option 2: Fully Automated (Zero-Interaction Mode) 💥

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

Option 3: Manual Download

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 History

Click to view full version history
Version Major Changes
V1Basic manual-like chroot logic for GRUB repair.
V2Added input validation (checks if partition exists) and loops for user input.
V3Added /mnt cleanup (umount -R) before starting to prevent mount conflicts.
V4Added 'set -e' for safety, forced Root partition input, OS detection.
V5Added '--removable' to fix VM/NVRAM issues, and TTY Pipeline support.
V6Added Auto-Detection using lsblk FSTYPE without mounting.
V7Added dynamic support for mounting custom volumes (e.g., /home, /var).
V8Added Root Validation, System Logging, and Smart EFI Detection.
V9Added dynamic Btrfs subvolumes support with smart routing.
V10Bulletproof Btrfs loop (forced y/n), fixed Archinstall /boot vs /boot/efi trap.
V11Zero-Interaction Mode (fstab parser), 3-Tier Fallback System.
V12Added Legacy BIOS (i386-pc) support, auto-detection, and Target Disk extraction.
V13Added OS Prober support to automatically detect dual-boot systems (e.g., Windows).
V14Added Dynamic Execution Timer with gamer-style human responses (The Speedrun Update).
V15Added Universal UEFI Support (32-bit/i386-efi) with dynamic bitness detection.
V16Added In-Situ (Local) Mode to repair GRUB directly from the running system without Live USB/chroot.
V17Deep Scan Engine, Kernel Cmdline Detection, & Unified UX Prompt.
V18Added CLI Flags (--version, -env l/h, -auto) for complete Zero-Interaction Automation.
V19Added universal support for RedHat/Fedora/CentOS family (dynamic grub2 commands & paths).
V20Chroot Health Check - Auto-detects and installs missing GRUB/EFI packages with DNS resolv support.
V21LUKS & LVM Encryption Support - Auto-detects, unlocks (visible password), and configures GRUB_ENABLE_CRYPTODISK.
V22Secure Boot & Shim Integration - Auto-detects Secure Boot, handles shim-signed, and MOK Enrollment.
V23Security Hardening & Bug Fixes - Dynamic MOK OTP, hidden LUKS passwords, config backups, and environment isolation.
V24The "Backend API" Update - Added JSON Endpoints (--sys-info, --json-scan) and explicit mapping for GUI integration.
V25The "Polishing" Update - VM/VirtIO Regex Fallback and Btrfs Hardening.
V26The "Modular" Update - Completely refactored the monolith script into a modular architecture with on-the-fly loading.
V27Current: The "Bulletproof" Update - Strict trap cleanup engine, download integrity verification, and global input validation.

📋 System Requirements

⭐ Star on GitHub