Upon logging in to a switch you may get the following error (with the formatting changed for display purposes):
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 and if auto-snapshot feature is not
This happens because the primary partition is corrupt. We can easily copy over the JunOS image from the backup partition to the primary partition with this command:
root@switch> request system snapshot media internal slice alternate
Formatting alternate root (/dev/da0s2a)…
Copying ‘/dev/da0s1a’ to ‘/dev/da0s2a’ .. (this may take a few minutes)
The following filesystems were archived: /
Assuming the copy is ok you can switch to the back to the primary partition with the following command:
root@switch> request system reboot slice alternate media internal
After that you should be all set (unless there’s a more serious problem with the partition).