Troubleshooting: Recovering SONiC Installation on a Switch
This document outlines the steps taken to successfully boot into NOS (SONiC) install mode on a switch after a boot failure.
Issue
The switch failed to boot into SONiC due to a missing or corrupted bootloader. Symptoms included:
- Stuck in GRUB rescue mode with error: file /boot/grub/normal.mod not found
.
- Unable to load the kernel directly from the GRUB shell.
- EFI bootloader files (bootx64.efi
, grubx64.efi
) were present but not loading properly.
Root Cause
- The GRUB bootloader was either misconfigured or corrupted.
- The switch's boot order and EFI configuration were not correctly aligned with the installed SONiC image.
- The ONIE boot partition was not properly mounted, preventing direct boot into SONiC.
Resolution
Step 1: Enter BIOS and Adjust Boot Order
- Power cycle the switch.
- Enter the BIOS setup by pressing DEL or ESC during boot.
- Navigate to the Boot Override section.
- Select
UEFI: Built-in EFI Shell
to enter the EFI shell.
Step 2: Load the Bootloader Manually from EFI Shell
-
From the EFI shell, list available file systems:
Example output:
-
Mount the EFI partition:
-
List available bootloader files:
Example output: -
Attempt to load the default bootloader:
Step 3: Select ONIE Install Option in GRUB
- After loading
bootx64.efi
, the GRUB menu appeared with ONIE options: ONIE: Install OS
ONIE: Rescue
-
ONIE: Uninstall OS
-
Selected "ONIE: Install OS" to trigger the installer.
Step 4: ONIE Network-Based Recovery
-
ONIE attempts to discover the network-based installer from the control node:
-
The installer is detected and executed:
-
ONIE downloads and prepares the SONiC image:
Step 5: Partition Repair and Installation
- ONIE attempts to repair and recreate partition tables:
-
ONIE successfully creates the partition:
-
ONIE formats and mounts the partition:
-
SONiC files are extracted and installed:
Step 6: Finalize Installation
- ONIE reported successful installation:
- ONIE rebooted the switch:
Step 7: Verify Successful Boot
-
After reboot, GRUB listed the installed SONiC image:
-
Booted into SONiC: