Juniper SRX – error: Could not format alternate root | Solution

srx-01This week I encountered this error for the first time in the years I’m working with JunOS now. Last week I installed two SRX’s at a remote datacenter location in NJ, US. All working fine and once back in my home country I added some monitoring checks to the devices and thought, well lets sync the JunOS alternate partition with the primary. This went just fine:

onno@net> show system snapshot media internal
Information for snapshot on       internal (/dev/da0s1a) (backup)
Creation date: Aug 29 13:54:23 2015
JUNOS version on snapshot:
junos  : 12.1X44-D35.5-domestic
Information for snapshot on       internal (/dev/da0s2a) (primary)
Creation date: Apr 7 13:29:14 2016
JUNOS version on snapshot:
junos  : 12.1X46-D40.2-domestic

onno@net> 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: /

Then I wanted to double check it both partitions contained the same version, and then I got the error:

onno@net> show system snapshot media internal
error: cannot mount /dev/da0s1a

Eehhh .. wait .. what? That’s not something you want to see on a SRX more than 6000km away. (this is a location with, for now, single internet connection)
So I retried the request snapshot command, without success:

onno@net> request system snapshot slice alternate
Formatting alternate root (/dev/da0s1a)…
error: Could not format alternate root

After digging around I found similar issues on EX’s which were cause by the backup partition still mounted. However I didn’t find the /dev/da0s1a mounted, but did find the following:

onno@net> start shell
% mount
(snip)
/dev/altroot on /altroot (ufs, local, noatime, soft-updates)
(snip)

Solution

Looking at the other SRX, there was no /dev/altroot mounted. So I just unmounted it, and ran the same commands again. Now there’s no error and all fine:

onno@net> start shell
% su –
Password:
root@net% umount /altroot
root@net% exit
logout
% exit
exit
onno@net> 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: /

onno@net> show system snapshot media internal
Information for snapshot on       internal (/dev/da0s1a) (backup)
Creation date: Apr 15 07:30:11 2016
JUNOS version on snapshot:
junos  : 12.1X46-D40.2-domestic
Information for snapshot on       internal (/dev/da0s2a) (primary)
Creation date: Apr 7 13:29:14 2016
JUNOS version on snapshot:
junos  : 12.1X46-D40.2-domestic

This entry was posted in Juniper and tagged , , , , , , . Bookmark the permalink.

19 Responses to Juniper SRX – error: Could not format alternate root | Solution

  1. Edin says:

    Thanks Onno,

    your post solved same issue on SRX650. Many thanks.

  2. Estre says:

    Great post. Very helpfull. You saved me. Thanks a lot

  3. Mechanix says:

    Great, thank you!!!

  4. John Simon says:

    Great it helped!

  5. Simon Brooks says:

    Helped very much on a SRX 650! Thank you

  6. Ferick says:

    Muchas Gracias
    Excelente Dato

  7. Hans Buitrago says:

    Great post.

    Very useful.

  8. Wayne says:

    Thanks again helped on SRX650

  9. Sergey Minsky says:

    Awesome! Thank you that was helpful!

  10. Thanks, this was very helpful when I encountered exactly the same error.

  11. Mauro says:

    Thank you!! works on a SRX300

  12. Boris says:

    Years later, but still usefull 😉 Solves same issue as well on SRX320.
    Many thanks.

    (I’ve discovered that this happens, if you previously started “request system snapshot slice alternate” and did not wait for it to finish and close your ssh session. In this case, the altroot will not be unmounted)

  13. Scott says:

    thank you. this worked

  14. Brandon Chun says:

    It’s very helpful for me. Thanks a lot!

  15. Ilya says:

    Many thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *