Upgrading compact flash cards in Juniper J/SRX routers, EX switches or M/T/TX/MX route engines

Every now and then the JUNOS image grows and Juniper deploys a larger compact flash in their devices like switches, branch routers and route engines. But for the devices already present in the network a need of upgrading the compact flash drive occur. Below is a procedure to make that upgrade a smooth as possible.

Upgrading devices without secondary hard drive
Some Juniper devices are not built with hard drive as complement to the compact flash. Typically this is J series, SRX series and EX series. First requirement is that the Juniper device have a secondary compact flash card slot or that it is possible to open the Juniper device and the compact flash is replaceable. Second requirement is that if the Juniper device is not equipped with a slot for a secondary compact flash card, an USB connected external compact flash drive writer is needed. The safest bet to get one that is supported is SanDisk’s flash writers. The picture below shows one that for certain is supported by JUNOS.
SanDisk Compact Flash Disk writer

First step is to cleanup the compact flash card:
request system storage cleanup

Answer “yes” to all questions.

Next step is to insert the flash drive into the USB port and insert a new compact flash card of proper size to support the new larger JUNOS image into the compact flash card writer. Then simply run:
request system snapshot partition media usb

This formats the compact flash card in the compact flash card writer and then performs a copy from the devices compact flash card complete with boot image and configuration. Then power off your device. Now remove the old compact flash card from the Juniper device and insert the one from the compact flash card writer.

If a removable compact flash card slot is present, insert the new compact flash card of proper size to support the new larger JUNOS image into the slot. Then run:
request system snapshot partition media removable-compact-flash as-primary

This formats the compact flash card in the removable compact flash card slot and then performs a copy from the devices compact flash card complete with boot image and configuration. as-primary also prepares the flash card and device to use the removable compact flash card as primary boot source. To reboot properly then run:
request system reboot media removable-compact-flash

Voila, the device boots on the new compact flash card and an upgrade to the new larger JUNOS image is possible. Keep the old compact flash as backup.

Upgrading devices with a secondary hard drive
Most larger Juniper systems like M,MX,T,TX and PTX have secondary hard drive in their route engine. This makes the compact flash upgrade procedure simpler in the way that a compact flash card writer is not needed. Do remember since that the upgarde procedure includes a reboot of the route engine so that if a non graceful switchover (GRES) strategy is not used, their will be traffic impact. If a GRES and/or GRES-NSR (non-stop routing) strategy is used on the REs, there is NO traffic impact.

First step is to cleanup the compact flash card:
request system storage cleanup

Answer “yes” to all questions.

Then login to the secondary RE. There perform:
request system snapshot partition

This performs a backup of the compact flash to the hard drive.

Then reboot on the disk:
request system reboot media disk

Check so that the secondary RE booted OK on the disk as boot media. Next power off your secondary RE. Perform a flash disk swap to the new compact flash crad with proper size to handle the new larger JUNOS image. Power up the RE. Then run:
request system snapshot partition

This formats the new compact flash card and copies the backup on the hard drive to the flash card. To reboot properly then run:
request system reboot media compact-flash

Now the secondary RE is done. Now move on to the primary RE. First change master ship to the secondary RE so the primary can be manipulated:
request chassis routing-engine master switch

Now repeat the actions for primary RE as performed for secondary RE. When that is done, the new larger JUNOS image can safely be installed.

So a summary:

Upgrading devices without secondary hard drive with removable compact flash card slot
request system storage cleanup
request system snapshot partition media removable-compact-flash as-primary
request system reboot media removable-compact-flash

Upgrading devices without secondary hard drive with external USB compact flash card writer
request system storage cleanup
request system snapshot partition media usb

Remove compact flash card from the device and replace with the new from the compact flash card writer.

Upgrading devices with a secondary hard drive
On the RE that is currently not master:
request system storage cleanup
request system snapshot partition
request system reboot media disk

Check so that the RE booted correctly on disk. Power off the RE. Remove the old compact flash from the RE and insert the new compact flash. Boot up the RE.
request system snapshot partition
request system reboot media compact-flash

Check so the RE booted up correctly.

Now switch master ship:
request chassis routing-engine master switch
On the RE that is currently not master:
request system storage cleanup
request system snapshot partition
request system reboot media disk

Check so that the RE booted correctly on disk. Power off the RE. Remove the old compact flash from the RE and insert the new compact flash. Boot up the RE.
request system snapshot partition
request system reboot media compact-flash

Check so the RE booted up correctly.

Good luck!

This entry was posted in Device Management, Managing Juniper devices. Bookmark the permalink.

Leave a Reply