How to Recover Junos OS with Upgraded FreeBSD
When you don't have access to the CLI, you can use the Junos Main Menu and Boot Menu to recover a device running 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 your root password. To determine if your system uses Junos OS with upgraded FreeBSD, see: Junos kernel upgrade to FreeBSD 10+.
For SRX300, SRX320, SRX340, SRX345, and SRX380 firewalls upgraded to Junos OS Release 24.4R1, see KB85650 for information on how to recover a system that is not booting normally. For these firewalls, you cannot use the Boot menu to boot from a USB device.
- Boot from the /junos Volume
- Boot from Safe Mode
- Boot from a Previously Installed Release of Junos OS with Upgraded FreeBSD
- Boot into Single-User Mode
- Boot from a Recovery Snapshot
- Boot from a USB Device
- Boot to the OAM Shell
- CLI Recovery Mode
- Check File System
- Enable/Disable Verbose Boot
- Boot Prompt
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:
root@:/ # ls -al /packages/sets/previous/ total 20 drwxr-xr-x 4 root wheel 1536 Mar 30 15:45 . drwxrwxrwx 4 root wheel 512 Mar 30 18:47 .. drwxr-xr-x 2 root wheel 512 Mar 30 15:45 boot lrwxr-xr-x 1 root wheel 66 Mar 30 15:44 jail-runtime -> /packages/db/jail-runtime-x86-32-20171012.356211_builder_stable_10 lrwxr-xr-x 1 root wheel 62 Mar 30 15:44 jdocs -> /packages/db/jdocs-x86-32-20171121.225603_builder_junos_161_r6 lrwxr-xr-x 1 root wheel 63 Mar 30 15:44 jpfe-X -> /packages/db/jpfe-X-x86-32-20171121.225603_builder_junos_161_r6 ...
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 a 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 device.
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
.
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.
For SRX300, SRX320, SRX340, SRX345, and SRX380 firewalls, you cannot use the Boot menu to boot from a USB device.
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.