Skip to content

Add linux-grub-repair script to automate GRUB re-installation on failed Linux VMs#123

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/automate-grub-reinstallation
Draft

Add linux-grub-repair script to automate GRUB re-installation on failed Linux VMs#123
Copilot wants to merge 2 commits intomainfrom
copilot/automate-grub-reinstallation

Conversation

Copy link
Copy Markdown

Copilot AI commented May 8, 2026

GRUB corruption is a recurring boot failure scenario with no dedicated automated repair path. This adds a focused linux-grub-repair script that handles GEN1 and GEN2 cases, and updates linux-alar2 docs to surface all available ALAR2 actions.

Changes

  • New src/linux/linux-grub-repair.sh — dedicated script wrapping ALAR2's grubfix/efifix actions:

    • Auto-detects GEN1 vs GEN2 by checking /sys/firmware/efi/efivars; runs grubfix (GEN1) or efifix (GEN2/EFI) accordingly
    • Accepts an optional override parameter (grubfix or efifix) with input validation
    • Fails fast with a clear error if the ALAR script download fails
  • Updated src/linux/linux-alar2.sh — expanded header docs to enumerate all supported ALAR2 actions (grubfix, efifix, auditd, sudo, corrupt) with descriptions and a multi-action usage example

  • Updated map.json — registers linux-grub-repair as a new run-id

Usage

# Auto-detect GEN1/GEN2 and reinstall GRUB
az vm repair run -g RGNAME -n VMNAME --run-id linux-grub-repair --run-on-repair

# Force GEN1
az vm repair run -g RGNAME -n VMNAME --run-id linux-grub-repair --parameters grubfix --run-on-repair

# Force GEN2/EFI
az vm repair run -g RGNAME -n VMNAME --run-id linux-grub-repair --parameters efifix --run-on-repair

… grub re-installation automation

Agent-Logs-Url: https://github.com/Azure/repair-script-library/sessions/abf07f2b-e20c-42bd-b3ff-b25a181f03f6

Co-authored-by: EdwinBernal1 <109677148+EdwinBernal1@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance automation for grub re-installation issue Add linux-grub-repair script to automate GRUB re-installation on failed Linux VMs May 8, 2026
Copilot AI requested a review from EdwinBernal1 May 8, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement --> automate grub re-installation issue

2 participants