How to automatically restore the primary partition from the backup partition on a SRX device.
- From 10.0, SRX branch devices support dual-root partitions.
- But if the backup partition is also corrupt, SRX will not be able to boot up.
With the Junos event policy, when SRX boots from the backup partition, it will copy the OS from the backup partition to the primary partition:
set event-options policy boot-chk events system set event-options policy boot-chk attributes-match system.message matches "Host 0 Boot from backup root" set event-options policy boot-chk then execute-commands commands "request system snapshot slice alternate"