Juniper EX and SRX series devices that are shipped with Junos OS release 10.4 or later are configured with resilient dual-root partitions. If the primary partition is corrupted then these Juniper devices can still continue to function normally by booting from the secondary (backup) partition.
Junos image on a primary root partition can get corrupted when there is an unexpected shutdown, power failure, or incompatible configurations. If the device fails to boot from the primary image then it will try booting from the backup image in the secondary partition. There are two ways you can notice that a Juniper device is booted from a backup image.
1. Warning Banner
A warning banner like below is displayed on the console every time a user log in.
********************************************************************** ** ** ** WARNING: THIS DEVICE HAS BOOTED FROM THE BACKUP JUNOS IMAGE ** ** ** ** It is possible that the primary copy of JUNOS failed to boot up ** ** properly, and so this device has booted from the backup copy. ** ** ** ** Please re-install JUNOS to recover the primary copy in case ** ** it has been corrupted. ** ** **********************************************************************
2. Alarm
An alarm is raised which can be viewed by issuing the show chassis alarms command.
root@SRX345> show chassis alarms 1 alarms currently active Alarm time Class Description 2019-08-08 16:19:18 BST Minor Host 0 Boot from backup root
Recovering the Junos image in primary partition
When you spot that a primary partition has failed you should try to recover it as soon as possible as you are left with only one root partition. The recovery of the primary partition can be done easily by taking a snapshot of the root file system in the secondary partition and copying it to the primary partition.
The following command takes a snapshot of the currently active partition (secondary partition) and copies it to the alternate partition (primary partition).
root@SRX345>request system snapshot slice alternate
Formatting alternate root (//dev//da0s1a)...
Copying '//dev//da0s2a' to '//dev//da0s1a' .. (this may take a few minutes)
The following filesystems were archived: //
Run the following command to verify that you have a valid backup image.
root@SRX> show system software backup
Backup JUNOS package information:
File name: //cf//packages//junos-15.1X49-D150.2-domestic
File size: 254838138
You can also use the show system storage partitions command to check both partitions.