|
| 1 | + |
| 2 | +# Troubleshooting: Recovering SONiC Installation on a Switch |
| 3 | + |
| 4 | +This document outlines the steps taken to successfully boot into NOS (SONiC) install mode on a switch after a boot failure. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## **Issue** |
| 9 | +The switch failed to boot into SONiC due to a missing or corrupted bootloader. Symptoms included: |
| 10 | +- Stuck in **GRUB rescue mode** with `error: file /boot/grub/normal.mod not found`. |
| 11 | +- Unable to load the kernel directly from the GRUB shell. |
| 12 | +- EFI bootloader files (`bootx64.efi`, `grubx64.efi`) were present but not loading properly. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## **Root Cause** |
| 17 | +- The GRUB bootloader was either misconfigured or corrupted. |
| 18 | +- The switch's boot order and EFI configuration were not correctly aligned with the installed SONiC image. |
| 19 | +- The ONIE boot partition was not properly mounted, preventing direct boot into SONiC. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## **Resolution** |
| 24 | + |
| 25 | +### **Step 1: Enter BIOS and Adjust Boot Order** |
| 26 | +1. Power cycle the switch. |
| 27 | +2. Enter the BIOS setup by pressing **DEL** or **ESC** during boot. |
| 28 | +3. Navigate to the **Boot Override** section. |
| 29 | +4. Select `UEFI: Built-in EFI Shell` to enter the EFI shell. |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +### **Step 2: Load the Bootloader Manually from EFI Shell** |
| 34 | +1. From the EFI shell, list available file systems: |
| 35 | +```bash |
| 36 | +map -r |
| 37 | +``` |
| 38 | +Example output: |
| 39 | +``` |
| 40 | +fs0 :HardDisk - Alias hd17a65535a1 blk0 |
| 41 | +fs1 :HardDisk - Alias hd17a65535a2 blk1 |
| 42 | +``` |
| 43 | + |
| 44 | +2. Mount the EFI partition: |
| 45 | +```bash |
| 46 | +fs0: |
| 47 | +``` |
| 48 | + |
| 49 | +3. List available bootloader files: |
| 50 | +```bash |
| 51 | +ls EFI/BOOT |
| 52 | +``` |
| 53 | +Example output: |
| 54 | +``` |
| 55 | +bootx64.efi |
| 56 | +grubx64.efi |
| 57 | +fbx64.efi |
| 58 | +grub.cfg |
| 59 | +``` |
| 60 | + |
| 61 | +4. Attempt to load the default bootloader: |
| 62 | +```bash |
| 63 | +EFI/BOOT/BOOTX64.EFI |
| 64 | +``` |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +### **Step 3: Select ONIE Install Option in GRUB** |
| 69 | +1. After loading `bootx64.efi`, the GRUB menu appeared with ONIE options: |
| 70 | + - `ONIE: Install OS` |
| 71 | + - `ONIE: Rescue` |
| 72 | + - `ONIE: Uninstall OS` |
| 73 | + |
| 74 | +2. Selected **"ONIE: Install OS"** to trigger the installer. |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +### **Step 4: ONIE Network-Based Recovery** |
| 79 | +1. ONIE attempts to discover the network-based installer from the control node: |
| 80 | +```text |
| 81 | +ONIE: Discovering installer... |
| 82 | +``` |
| 83 | + |
| 84 | +2. The installer is detected and executed: |
| 85 | +```text |
| 86 | +ONIE: Executing installer: http://172.30.0.1:32000/onie |
| 87 | +``` |
| 88 | + |
| 89 | +3. ONIE downloads and prepares the SONiC image: |
| 90 | +```text |
| 91 | +NOS: Verifying image checksum ... OK. |
| 92 | +NOS: Preparing image archive ... OK. |
| 93 | +NOS: Installing SONiC in ONIE |
| 94 | +``` |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +### **Step 5: Partition Repair and Installation** |
| 99 | +1. ONIE attempts to repair and recreate partition tables: |
| 100 | +```text |
| 101 | +NOS: Partition #3 is available |
| 102 | +NOS: Creating new SONiC-OS partition /dev/sda3 ... |
| 103 | +``` |
| 104 | +2. ONIE successfully creates the partition: |
| 105 | +```text |
| 106 | +NOS: The operation has completed successfully. |
| 107 | +``` |
| 108 | + |
| 109 | +3. ONIE formats and mounts the partition: |
| 110 | +```text |
| 111 | +NOS: Creating filesystem with 7588935 4k blocks and 1900544 inodes |
| 112 | +``` |
| 113 | + |
| 114 | +4. SONiC files are extracted and installed: |
| 115 | +```text |
| 116 | +NOS: inflating: boot/vmlinuz-5.10.0-21-amd64 |
| 117 | +NOS: inflating: boot/initrd.img-5.10.0-21-amd64 |
| 118 | +NOS: inflating: platform-modules-ag9032v2a_1.1_amd64.deb |
| 119 | +``` |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +### **Step 6: Finalize Installation** |
| 124 | +1. ONIE reported successful installation: |
| 125 | +```text |
| 126 | +NOS: Installed SONiC base image SONiC-OS successfully |
| 127 | +``` |
| 128 | +2. ONIE rebooted the switch: |
| 129 | +```text |
| 130 | +ONIE: NOS install successful: http://172.30.0.1:32000/onie |
| 131 | +ONIE: Rebooting... |
| 132 | +``` |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +### **Step 7: Verify Successful Boot** |
| 137 | +1. After reboot, GRUB listed the installed SONiC image: |
| 138 | +``` |
| 139 | +* SONiC-OS-4.4.1-Enterprise_Base |
| 140 | + ONIE |
| 141 | +``` |
| 142 | + |
| 143 | +2. Booted into SONiC: |
| 144 | +```text |
| 145 | +Debian GNU/Linux 11 sonic ttyS1 |
| 146 | +System is ready |
| 147 | +``` |
0 commit comments