Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Restoring Junos OS

Creating an Emergency Boot Device

Before you begin, you need to download the installation media image for your device and Junos OS release from https://www.juniper.net/customers/support/ .

If Junos OS on the device is damaged in some way that prevents the software from loading properly, you can use an emergency boot device to repartition the primary disk and load a fresh installation of Junos OS. Use the following procedure to create an emergency boot device.

Note:

You can create the emergency boot device on another Juniper Networks router or router, or any PC or laptop that supports Linux. The steps you take to create the emergency boot device vary, depending on the device.

To create an emergency boot device:

  1. Use FTP to copy the installation media image into the /var/tmp directory on the device.
  2. Insert a USB device into the USB port.
  3. From the Junos OS command-line interface (CLI), start the shell:
  4. Switch to the root account using the su command:
    Note:

    The password is the root password for the device. If you logged in to the device as root, you do not need to perform this step.

  5. Enter the following command on the device:

    The device writes the installation media image to the USB device:

  6. Enter the following command:

    The device writes the installation media image to the USB device:

    Note:

    The device automatically create a recovery Junos OS image.

    The “Select a recovery image” menu appears on the console when one of these routers is booted and unable to load a version of Junos OS. You can follow the instructions in the “Select a recovery image” menu to load the Junos OS image for one of these routers.

  7. Log out of the shell:

Performing a Recovery Installation Using an Emergency Boot Device

If Junos OS on your device is damaged in some way that prevents the software from loading correctly, you might need to perform a recovery installation using an emergency boot device (for example, a USB flash drive) to restore the default factory installation. After you have recovered the software, you need to restore the device configuration. You can either create a new configuration as you did when the device was shipped from the factory, or if you saved the previous configuration, you can simply restore that file to the device.

We recommend that you perform the following steps before you perform the recovery installation:

  1. Ensure that you have an emergency boot device to use during the installation. See Creating an Emergency Boot Device for information about how to create an emergency boot device.

  2. Copy the existing configuration in the file /config/juniper.conf.gz from the device to a remote system, such as a server, or to an emergency boot device. For extra safety, you can also copy the backup configurations (the files named /config/juniper.conf.n, where n is a number from 0 through 9) to a remote system or to an emergency boot device.

    You can use the system snapshot feature to complete this step. The system snapshot feature takes a “snapshot” of the files currently used to run the MX10008 router—the complete contents of the /config and /var directories, which include the running Juniper Networks Junos OS, the active configuration, and the rescue configuration—and copies all of these files into a memory source.

    Warning:

    The recovery installation process completely overwrites the entire contents of the internal flash storage.

  3. Copy any other stored files to a remote system as desired.

To reinstall Junos OS:

  1. Insert the emergency boot device into the router.

  2. Power cycle the router.

    The emergency boot device is detected. At this time, you can load Junos OS from the emergency boot device onto the internal flash storage.

  3. Install Junos OS by choosing one of the following options:

    • If you have a snapshot saved on the emergency boot device, the system prompts you with the following option.

      Select Install Junos Snapshot to install the snapshot.

    • If Junos OS is installed at the factory on the emergency boot device, the system prompts you with the following option.

      Select Install Juniper Linux Platform to install the Junos OS software from the emergency boot device.

    The device copies the software from the emergency boot device, occasionally displaying status messages. Copying the software can take up to 12 minutes.

  4. After the software is copied from the emergency device to the device, the device reboots from the internal flash storage on which the software was just installed. When the reboot is complete, the device displays the Junos OS login prompt:

  5. Create a new configuration as you did when the device was shipped from the factory, or restore the previously saved configuration file to the device.

  6. Remove the emergency boot device.