This article discusses how to create, verify recovery and non-recovery snapshots on Junos devices.
A non-recovery snapshot is stored in Junos OS volume used for running the device software and hold the configuration and the logs.
A recovery snapshot stored in OAM (Operations, Administration, and Maintenance) volume holds a full backup that can be used in case something goes wrong with Junos volume
There are two types of snapshots:
Non-Recovery Snapshot: Resides on the Junos volume. Points to the current set of packages and configuration at the time when the snapshot was taken. Multiple non-recovery snapshots can be taken. They can be renamed. Can be used to boot from them at the next reboot. Recovery Snapshot: Resides on the OAM volume There can be only one at a time Can be used to recover the Junos volume Contains a full copy of the packages and configuration at the time when the snapshot
Non-Recovery Snapshot:
Recovery Snapshot:
How to create a non-recovery snapshot
root@EX34xx> request system snapshot fpc0: -------------------------------------------------------------------------- NOTICE: Snapshot snap.20170908.011626 created successfully >>> Snapshot Created root@EX34xx>
How to check the list of non-recovery snapshots
root@EX34xx> show system snapshot fpc0: -------------------------------------------------------------------------- Non-recovery snapshots: Snapshot snap.20170908.011626: Location: /packages/sets/snap.20170908.011626 <----- Here is the snapshot package Creation date: Sep 8 01:16:27 2017 Junos version: 15.1X53-D56
How to boot the device from non-recovery snapshot ( /dev/gpt/junos (Junos volume)
/dev/gpt/junos
root@EX3400> request system snapshot load snap.20170223.114901 fpc0: -------------------------------------------------------------------------- NOTICE: Loaded snapshot snap.20170223.114901. <----- Loading this package NOTICE: This command requires a reboot to complete the operation. NOTICE: To cancel this operation, run 'request system software rollback'
How to delete the non-recovery snapshot
root@EX3400> request system snapshot delete snap.20170223.114901 fpc1: -------------------------------------------------------------------------- NOTICE: Snapshot 'snap.20170223.114901' deleted successfully
How to create a recovery snapshot
root@EX34xx> request system snapshot recovery fpc0: -------------------------------------------------------------------------- Creating image ... Compressing image ... Image size is 243MB Recovery snapshot created successfully
Recovery snapshot does the same thing as request system snapshot slice alternate on the older platforms of EX series devices.
request system snapshot slice alternate
How to delete recovery snapshot stored in the OAM volume
Mount the OAM partition:
root@switch>start shell user root %mount /dev/gpt/oam /oam %ls -l /oam/ %cli
Delete the recovery snapshot:
%cli
root@switch>file list /oam/snapshot/
root@switch>file delete /oam/snapshot/recovery.ufs.uzip
root@switch>show system snapshot
You should see an output similar to the following:
root@switch> show system snapshot fpc0: -------------------------------------------------------------------------- No non-recovery snapshots available on the Junos volume Recovery Snapshots: mount: /dev/gpt/oam: Device busy No recovery snapshots available on the OAM volume <----- recovery snapshot has been deleted
[master:0] root@switch>
Then, unmount the oam partition:
root@switch> start shell user root %umount /dev/gpt/oam
How to recover the OAM volume
root@EX3400> request system recover oam-volume NOTICE: Recovering the OAM volume ... da0p1 deleted da0p1 added /dev/gpt/oam: 500.0MB (1024000 sectors) block size 32768, fragment size 4096 using 4 cylinder groups of 125.03MB, 4001 blks, 16128 inodes. super-block backups (for fsck_ffs -b #) at: 192, 256256, 512320, 768384 Verified oam signed by PackageProductionEc_2016 method ECDSA256+SHA256 Installing OAM volume contents ... The OAM volume is now installed NOTICE: Creating a recovery snapshot on the OAM volume ... Creating image ... Compressing image ... Image size is 243MB Recovery snapshot created successfully NOTICE: OAM volume recovered <----- Recovered
In case you are unable to create recovery snapshot due to 'ERROR: The OAM volume is too small ' , refer to KB33892 - 'ERROR: The OAM volume is too small to store a snapshot' message while creating a recovery snapshot on RE1800 [juniper.net] NOTE: Make sure you are running the supported version on the device before attempting to execute the commands. The documents in the Related Links section lists the versions in which this command was introduced.
'ERROR: The OAM volume is too small '
2021-10-14: Updated related links, minor format changes. 2020-05-15: Updated the Title, Summary, Cause, Solution, and added Products to the list OAM. 2020-07-20: Added ' How to delete recovery snapshot stored in the OAM volume ' section