Here's the procedure I use when recovering a system or if I just want to blow away the entire file system (including any config, etc):
Here's the procedure to upgrade by USB device:
1) The USB stick that we are using, must be formatted in the FAT 32 file system (if using windows, right click on the device and select format).
2) Copy the JUNOS image to the root of the USB stick.
3) Once the image is on the USB stick, we need to do a safe remove from the client machine we are on, to ensure there are no CRC errors etc.
4) We then need to plug the USB stick into the back of the switch (in the USB port).
5) Reboot the switch.
6) After the switch reboots, wait for "Loading /boot/defaults/loader.conf/ kernel", at which point press the space bar key.
This will take you to the loader prompt.
At this prompt do the following:
Loader> install --format file:///<exact junOS image name>
In our case, we'd do this (notice there are 3 slashes😞
Loader> install --format file:///jinstall-ex-4200-10.0R4.7-domestic-signed.tgz
This should initiate the format + install process (it can take up to 15 minutes to complete).