Recovering from a System Crash
If the operating system cannot be used or is not found, the boot loader still allows access into the switch via a command-line that provides access to the files stored in the flash memory. So you can still access the boot loader via a console connection
This can be performed in 5 Steps as follows:
| Accessing the Boot Loader when OS is not found or is corrupted |
|---|
| Step 1 (Power-On Self-Test / POST) |
| Connect a PC/Laptop via the console cable to the switch console port. (via PuTTY / MobaXterm etc…) |
| Step 2 (Loads the Bootloader) |
| Disconnect the power cord from the switch |
| Step 3 (CPU Initialization) |
| Reconnect the power cord to the switch and press and hold down the Mode button while the System LED is still flashing green within the first 15 seconds. |
| Step 4 (Flash File System Initialization) |
| Keep on pressing the Mode button until the System LED turns briefly amber and then solid green. Release the Mode button. |
| Step 5 (Locate and Load IOS) |
| The boot loader switch: prompt appears in the terminal emulation software (ex. PuTTY) on the PC. You can now use the following commands to recover the system |
Command to view the path of the switch BOOT environment variable
switch: set BOOT=flash:/c2960-lanbasek9-mz.122-55.SE7/c2960-lanbasek9-mz.122-55.SE7.bin (output omitted)
Command to initialize the flash file system
switch: flash_init Initializing Flash… flashfs[0]: 2 files, 1 directories flashfs[0]: 0 orphaned files, 0 orphaned directories flashfs[0]: Total bytes: 32514048 flashfs[0]: Bytes used: 11838464 flashfs[0]: Bytes available: 20675584 flashfs[0]: flashfs fsck took 10 seconds. …done Initializing Flash.
Command to change the BOOT environment variable path the switch will now use to load IOS
switch: BOOT=flash:c2960-lanbasek9-mz.150-2.SE8.bin
Boot the Switch using the new path
switch: boot
Complete Boot Recovery Example Configuration
switch: set BOOT=flash:/c2960-lanbasek9-mz.122-55.SE7/c2960-lanbasek9-mz.122-55.SE7.bin (output omitted) switch: flash_init Initializing Flash… flashfs[0]: 2 files, 1 directories flashfs[0]: 0 orphaned files, 0 orphaned directories flashfs[0]: Total bytes: 32514048 flashfs[0]: Bytes used: 11838464 flashfs[0]: Bytes available: 20675584 flashfs[0]: flashfs fsck took 10 seconds. …done Initializing Flash. switch: BOOT=flash:c2960-lanbasek9-mz.150-2.SE8.bin switch: boot