Description

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.

Symptoms

Symptoms


  • What is the procedure to recover a device using the "Recovery" snapshot when the primary Junos partition is corrupted or fails to boot?

Solution

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 the event of software corruption 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 the Junos OS using the "Recovery" snapshot. For detailed instructions on how to create both Recovery and "Non-Recovery" snapshots, please refer to the following link:

 

https://supportportal.juniper.net/s/article/Recovery-and-Non-recovery-snapshots-on-Junos-devices

 

NOTE: 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:

 

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:

 

  • Turn off the power to the management device.
  • 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.
  • Plug the RJ-45–to–DB-9 serial port adapter into the serial port on the management device.
  • Connect the other end of the Ethernet rollover cable to the console port on the device.
  • Turn on the power to the management device.
  • 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).

 

3.Configure the port settings as follows:

 

  • Bits per second: 9600
  • Data bits: 8
  • Parity: None
  • Stop bits: 1
  • Flow control: None

 

4.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.

 

5.Access the Junos Main Menu.

Press Ctrl+c within the 3-second window to stop the automatic boot sequence and display the Junos Main Menu.

 

 

Main Menu

 

1. Boot [D]irectly fromJunos volume

2. Boot Junos volume in [S]afe mode

 

3. [R]eboot

 

4. [B]oot menu

5. [M]ore options

 

Choice: 

 

 

6.At the Choice: prompt in Junos Main Menu, enter B or 4 to choose 4. [B]oot menu. Only the options valid for your device appear. The menu numbers change based on what's available:

 

 

Boot Menu

 

1. Boot [P]revious installed Junos packages

2. Boot [A]ctive Junos packages

3. Boot Junos in [S]ingle user mode

4. Boot from [R]ecovery snapshot

5. Boot from [Network]

6. Boot from [U]SB

 

7. Boot to [O]AM shell

 

8. Snapshot [B]oot menu

 

9. [M]ain menu

 

Choice: 

 

 

7.At the Choice: prompt in Boot Menu, enter R or 3 to choose the 4. Boot from [R]ecovery snapshot option. The device reboots into recovery mode. The following sample output shows the messages displayed on the terminal when you recover Junos OS on an EX2300 switch:

 

 

Booting from recovery snapshot ...

-

/boot/junos/boot/os-kernel/kernel data=0xe8c000 syms=[0x4+0x6b020+0x4+0x72cfe]

/boot/junos/boot/os-kernel/ex2300-48mp.dtb size=0x18b8

/boot/junos/boot/os-kernel/ex2300.dtb size=0x1e67

/boot/junos/boot/junos-modules/fips_core.ko text=0x13bc data=0x275+0x7 syms=[0x4+0x7a0+0x4+0x518]

loading required module 'netstack'

/boot/junos/boot/netstack/netstack.ko text=0x910a3c data=0x3ae2f+0x10dded syms=[0x4+0xf0570+0x4+0xdc394]

loading required module 'crypto'

/var/pdb/profile_db initialized                                                 

Profile database initialized

realpath: /dev/dumpdev: No such file or directory

/etc/rc: WARNING: Dump device does not exist. Savecore not run.

Prefetching /usr/sbin/rpd ...

Prefetching /usr/sbin/lacpd ...

Prefetching /usr/sbin/chassisd ...

mkdir: /packages/sets/active: Read-only file system

Starting jlaunchhelperd.

sysctl: unknown oid 'kern.rtc_retries'

Starting cron.          

Fri Jun 22 01:25:20 PDT 2018                                                  

FreeBSD/arm (device-name) (ttyu0)                                           

login:

 

 

8.Log in to the device and run the command "request system recover junos-volume":

 

 

--- JUNOS 18.1-20180125.0 built 2018-01-25 20:34:55 UTC

root@:RE:0% FreeBSD/arm (Amnesiac) (ttyu0)

 

login: root

 

--- JUNOS 

Note: Junos is currently running in recovery mode on the OAM volume

root@:RE:0% CLI

root> request system recover junos-volume

NOTICE: Recovering the Junos volume ... 

...

 

 

9.Reboot the device to finish the recovery:

 

 

root> request system reboot junos

 

 

For more information about Recovery of Junos, please visit:

 

https://www.juniper.net/documentation/us/en/software/junos/junos-install-upgrade/topics/topic-map/recovery-of-junos-os.html

Modification History

2025-10-10 : Article Created