Recovery of Junos OS
In case of a failed software installation or a failure after installing Junos OS, such as the CLI not working, you can recover the failed software. You can recover the software by installing Junos OS and remove the existing Junos OS image to install a new image.
Recovering from a Failed Software Installation
Problem
Description
If the Junos OS appears to have been installed but the CLI does not work, or if the device has no software installed, you can use this recovery installation procedure to install the Junos OS.
Solution
If a Junos OS image already exists on the switch, you can either install the new Junos OS package in a separate partition, in which case both Junos OS images remain on the switch, or you can remove the existing Junos OS image before you start the new installation process.
QFX5100, QFX5200, EX4600, QFX10000, and OCX Series switches do not have a separate partition to reinstall a Junos OS image.
A recovery image is created automatically on these switches. If a previously-running switch is powered on and unable to boot using a Junos OS image, you can boot the switch using the recovery Junos OS image by selecting an option in the “Select a recovery image” menu.
We suggest creating a system snapshot on your switch onto the external USB flash drive, and using the snapshot for recovery purposes. The system snapshot feature takes a “snapshot” of the files currently used to run the device—the complete contents of the /config directories, which include the running Juniper Networks Junos OS, the active configuration, and the rescue configuration, as well as the host OS—and copies all of these files into an external USB flash drive. See Creating a Snapshot and Using It to Boot a QFX3500 and QFX3600 Series Switch or Creating a Snapshot and Using It to Boot a QFX Series Switch.
System snapshot is not supported on QFX5200 and QFX10000 switches.
To perform a recovery installation:
Power on the switch. The loader script starts.
After the message Loading /boot/defaults/loader.conf appears, you are prompted with the following message:
Hit [Enter] to boot immediately, or space bar for command prompt.
Press the Spacebar to enter the manual loader. The
loader>
prompt appears.Note:The loader prompt does not appear on QFX5100, QFX5200, EX4600, QFX10000, and OCX Series switches.
On QFX5100, QFX5200, EX4600, QFX10000, and OCX Series switches only, a recovery image is automatically saved if a previously-running switch is powered on and unable to boot using a Junos OS image.
The “Select a recovery image” menu appears on the console when one of these switches is booted and unable to load a version of Junos OS. Follow the instructions in the “Select a recovery image” menu to load the recovery version of Junos OS for one of these switches.
You can ignore the remainder of this procedure if you are using a QFX5100, QFX5200, EX4600, QFX10000, or OCX Series switch.
Enter the following command:
loader> install [––format] [––external] source
where:
format
—Enables you to erase the installation media before installing the installation package. If you do not include this option, the system installs the new Junos OS in a different partition from that of the most recently installed Junos OS.external
—Installs the installation package onto external media (a USB stick, for example).source
—Represents the name and location of the Junos OS package, either on a server on the network or as a file on an external media, as shown in the following two examples:Network address of the server and the path on the server; for example, tftp://192.0.2.0/junos/jinstall-qfx-5e-flex-15.1X53-D30.5-domestic-signed.tgz
Junos OS package on a USB device (commonly stored in the root drive as the only file), for example, file://jinstall-qfx-5e-flex-15.1X53-D30.5-domestic-signed.tgz).
The installation now proceeds normally and ends with a login prompt.
See Also
Recovering Junos OS on a Device Running Junos OS with Upgraded FreeBSD
Certain hardware platforms run an upgraded FreeBSD kernel (FreeBSD 10.x or later) instead of FreeBSD 6.1. Juniper Networks devices that run Junos OS with upgraded FreeBSD have two separate volumes:
-
dev/gpt/junos (/junos for short) volume that is used to run Junos OS and to store the configuration and log files
-
dev/gpt/oam (/oam for short), an Operations, Administration, and Maintenance (OAM) volume that is used to store a complete backup of Junos OS and the configuration.
In case of damage to the device’s software or failure of the /junos
volume, you can use the backed up software and configuration stored in the
/oam volume to boot the system and restore Junos OS with the
recovery configuration. To perform this reboot and restore the configuration, the
/oam volume must have all of the information required to
provide the system with a running configuration. This information is provided by the
recovery snapshot, created using the request system snapshot recovery
command.
You need console access to perform the following procedure to recover Junos OS.
To recover Junos OS by using the recovery snapshot stored in the /oam volume: