Wednesday, 1 July 2026

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.

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

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

    content_copy zoom_out_map
    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: 
  5. 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.
    content_copy zoom_out_map
    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: 
    Show more 
  6. 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.
    content_copy zoom_out_map
    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'
    
    [...Output truncated...]
    
    /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:
    Show more 
  7. Log in to the device and run the command request system recover junos-volume.
    content_copy zoom_out_map
    [...Output truncated...]
    login: root
    
    --- 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
    {master:0}
    root> request system recover junos-volume
    NOTICE: Recovering the Junos volume ... 
    ...
    Show more 
  8. Reboot the device to finish the recovery.
    content_copy zoom_out_map
    root> request system reboot junos
loading...