Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

How to Recover Junos OS with Upgraded FreeBSD

Ways to Recover Junos OS with Upgraded FreeBSD Without the Use of the CLI

If a device running Junos OS with upgraded FreeBSD has a damaged operating system or configuration that prevents the system from booting normally, or you need to recover the root password, the CLI is unavailable to you. But you can access and use the Junos Main Menu and Boot Menu. These menus have options such as booting from a USB device or a previously installed version of Junos OS, or using CLI Recovery mode to change you root password.

Boot from the /junos Volume

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.

If a device running Junos OS with upgraded FreeBSD has a damaged operating system or configuration, preventing the system from booting normally, you can still boot from the /junos volume without using the CLI command request system reboot. Access the Junos Main Menu. Booting the /junos volume is the first option on the Junos Main Menu.

Boot from Safe Mode

Safe mode is a diagnostic mode of a computer’s operating system that has reduced functionality, making the task of isolating problems easier since many non-core components are disabled. In Junos OS with upgraded FreeBSD, safe mode boots the entire Junos OS and FreeBSD but with a few kernel features disabled.

One other difference between normal mode and safe mode is that for EX3400 devices, symmetric multiprocessing (SMP) in normal mode uses a dual core, whereas in safe mode, it uses a single core.

An installation that has a major problem (such as disk corruption or the installation of poorly configured software) that prevents the operating system from booting into its normal operating mode may boot in safe mode and allow you to diagnose the problem.

Booting from Safe Mode is the second option on the Junos Main Menu.

Boot from a Previously Installed Release of Junos OS with Upgraded FreeBSD

With devices running Junos OS with upgraded Freebsd, you can boot from a previous release of the OS, provided there was a previous image on the device and it is still there. Previous image files can be found in the /packages/sets/previous directory. Some platforms do not keep an older image due to storage space limitations (for example, EX2300 and EX3400 do not have a /packages/sets/previous directory).

The following is sample output from an EX9200 switch, showing the previous image:

To see if there are previous packages on the device, do one of the following:

  • From a UNIX shell, issue the ls /packages/sets/previous command.

  • From the CLI operational mode, use the file list /packages/sets/previous command.

Booting from a previously installed release of Junos OS with upgraded FreeBSD is the first option on the Boot Menu.

System boots the previous Junos OS with upgraded FreeBSD image. If there is no previous image, system boots from the currently installed image.

Boot into Single-User Mode

Single-user mode is a mode in which a multi-user computer operating system boots into a single superuser. It is mainly used for maintenance of multi-user environments.

For devices running Junos OS with upgraded FreeBSD, single-user mode puts you in a shell with a prompt. There is limited support and password recovery is not possible using this option. But you can do few file operations.

Booting into single-user mode is the second option on the Boot Menu..

Boot from a Recovery Snapshot

A recovery snapshot for devices running Junos OS with upgraded FreeBSD is taken with the request system snapshot recovery command. Recovery snapshots are full copies of the packages and configuration taken at the time the snapshot command is issued.

Booting from a recovery snapshot is the third option on the Boot Menu.

Boot from a USB Device

If you want to boot from a USB device, you must connect the USB device to the router or switch. Then select the Boot from [U]SB option on the Boot Menu. If no USB device is connected, you will see a message No USB media found.

Note:

On Linux-based platforms (jinstall-host* images) where Junos OS with upgraded FreeBSD runs as a guest virtual machine (VM), the boot from USB option is supported through the BIOS Boot Manager. After rebooting, press ESC to open the boot options menu and select the Boot Manager option.

Boot to the OAM Shell

The Boot to the OAM Shell option is similar to the single-user mode except that you are put into the oam shell or volume. The compact flash drive is the /oam volume and stores recovery snapshot backup information. In case of failure of the /junos volume, the /oam volume can be used to boot the system.

Booting to the oam shell is the fifth option on the Boot Menu.

CLI Recovery Mode

If you choose the CLI Recovery Mode option, you end up at a root> prompt. Enter configure at the prompt to enter the configuration CLI mode. From there you can change the root password to recover your access to the device (see Recovering the Root Password on Routers).

The CLI Recovery Mode is the second option on the Options Menu.

Check File System

The check file system option lets you make sure there are no issues or corrupted files. The system boots from the OAM volume to perform disk checks. This is the third option on the Options Menu.

Enable/Disable Verbose Boot

Choosing the fourth option on the Options Menu either enables verbose boot, which lets you see the whole boot scroll by, or disables verbose boot.

Boot Prompt

The Boot Prompt option displays an OK prompt from which you can type one of the following commands:

  • menu—Takes you back to the Junos Main Menu.

  • boot-junos—Boots the device to the current version of Junos OS.

  • reboot—Reboots the system.

You can also type ? at the OK prompt to see several other available commands. The boot prompt option is the fifth option on the Options Menu.

How to Access the Junos Main Menu, Boot Menu, and Options Menu

If a device running Junos OS with upgraded FreeBSD has a damaged operating system or configuration, preventing the system from booting normally, you can still boot using an option on the Junos Main Menu, Boot Menu, or Options Menu. The following procedures show you how to access these menus.

How to Access the Junos Main Menu

You access the Junos Main Menu by interrupting the reboot of a device.

Note:

You need console access (either direct access to console or via a console server) to perform the following procedure.

You can either perform the entire procedure or power-cycle the device and start the procedure from Step 4. (You can also perform these reboots by rebooting the device via the CLI if that is available.)

To boot a device running Junos OS with upgraded FreeBSD without using the CLI:

  1. Power off the device, such as a router or a switch, by pressing the power button on the front panel.
  2. Connect and configure the management device, such as a PC or a laptop, as follows:
    1. Turn off the power to the management device.
    2. Plug one end of the Ethernet rollover cable supplied with the device into the RJ-45–to–DB-9 serial port adapter supplied with the device.
    3. Plug the RJ-45–to–DB-9 serial port adapter into the serial port on the management device.
    4. Connect the other end of the Ethernet rollover cable to the console port on the device.
    5. Turn on the power to the management device.
    6. On the management device, start your asynchronous terminal emulation application (such as Microsoft Windows Hyperterminal) and select the appropriate communication (COM) port to use (for example, COM1).
    7. Configure the port settings as follows:
      • Bits per second: 9600

      • Data bits: 8

      • Parity: None

      • Stop bits: 1

      • Flow control: None

  3. Power on the device by pressing the power button on the front panel.

    Verify that the POWER LED on the front panel turns green.

    The terminal emulation screen on your management device displays the boot sequence of the device.

  4. Access the Junos Main Menu.

    Do one of the following

    • Prior to Junos OS Release 17.3, the Junos Main Menu appears for three seconds on startup before automatically booting from the /junos volume. Press any key within the three-second interval to stop the automatic boot sequence and display the Junos Main Menu.

    • Starting in Junos OS Release 17.3, press Ctrl+c at the following part in the reboot:

    The Junos Main Menu is displayed:

  5. At the Choice: prompt in the Junos Main Menu, enter the number representing the option you want to use. Alternatively, you can enter the letter in square brackets to choose an option.

How to Access the Boot Menu

The Boot Menu is one of two menus you can access from the Junos Main Menu.

Note:

You need console access to perform the following procedure.

You must first access the Junos Main Menu. See How to Access the Junos Main Menu, Boot Menu, and Options Menu.

To access the Boot Menu:

  1. At the Choice: prompt in the Junos Main Menu, enter 4 or B to choose 4. [B]oot menu.

    The Boot Menu is displayed.

  2. At the Choice: prompt in the Boot Menu, enter the number representing the option you want to use. Alternatively, you can enter the letter in square brackets to choose an option.

How to Access the Options Menu

The Options Menu is one of two menus you can access from the Junos Main Menu.

Note:

You need console access to perform the following procedure.

You must first access the Junos Main Menu. See How to Access the Junos Main Menu, Boot Menu, and Options Menu.

To access the Options Menu:

  1. At the Choice: prompt in the Junos Main Menu, enter 5 or M to choose 5. [M]ore options.

    The Options Menu is displayed.

  2. At the Choice: prompt in the Options Menu, enter the number representing the option you want to use. Alternatively, you can enter the letter in square brackets to choose an option.