This articles explains the correct command to format the internal media of an SRX, running any of the following software versions:
Formatting the firewall should be the last recovery method to restore it because this will erase almost all files by formatting the file system. If this step is taken, a Root Cause Analysis or recovery of any information from the device will not be possible.
Attempted to format SRX from Loader by following KB20643 - [EX Switch] Rewrite the entire file system by issuing "install --format" command from "Loader" mode (Format Install) but an 'invalid URL' message appears:
loader>
loader> install --format file:///junos-srxsme-15.1X49-D140.2-domestic.tgz
invalid URL
loader>
On SRX devices, the '-- format' option is not needed.
Find the Format Install procedures (TFTP and USB) in KB20643 - [EX Switch] Rewrite the entire file system by issuing "install --format" command from "Loader" mode (Format Install) .
SRX example:
loader> install file:///junos-srxsme-15.1X49-D140.2-domestic.tgz
Target device selected for installation: internal media
/kernel data=0xba1734+0x152c64 syms=[0x4+0xa0930+0x4+0xf0607]
.
[output truncated]
.
da1 at umass-sim1 bus 1 target 0 lun 0
da1: <SanDisk Cruzer Edge 1.26> Removable Direct Access SCSI-5 device <-- Recognition of USB flash, if used.
da1: 40.000MB/s transfers
.
[output truncated]
.
Starting JUNOS installation:
Source Package: disk1:/junos-srxsme-15.1X49-D140.2-domestic.tgz
Target Media : internal
Product : srx300
Computing slice and partition sizes for /dev/da0 ...
media 7672 root 600 var 5151 cfg 191 swap 1030 800
Attempting to save existing configuration... <-- Current configuration is saved.
** /dev/da0s3e
FILE SYSTEM CLEAN; SKIPPING CHECKS
clean, 94755 free (19 frags, 11842 blocks, 0.0% fragmentation)
Found configuration in /dev/da0s3e
Formatting target media /dev/da0 ... <-- SRX’s internal media is formatted.
Preparing to create slices on /dev/da0
Running the 'install'
command will perform the following steps among others.
-
Format the internal media of the device, deleting the content of directories like /var/log/ and /var/tmp/ .
-
Delete and regenerate SSH Keys.
-
Delete rollback configuration files.
-
Save the current configuration file, installed licenses, the factory-defaults configuration file and the rescue configuration file.
To delete the configuration file, rescue configuration file and the installed licenses, run a request system zeroize media prior to formatting the internal media of the SRX.