Difference between revisions of "Booting A Juniper Switch From USB"

From Baranoski.ca
Jump to navigation Jump to search
Line 74: Line 74:
 
/dev/da0s2a    /dev/da0s4      /dev/da1s1c    /dev/da1s3d
 
/dev/da0s2a    /dev/da0s4      /dev/da1s1c    /dev/da1s3d
 
root@:LC:1% dd if=/dev/zero of=/dev/da0 bs=1M count=1100
 
root@:LC:1% dd if=/dev/zero of=/dev/da0 bs=1M count=1100
 
+
dd: /dev/da0: end of device
 +
1001+0 records in
 +
1000+0 records out
 +
1048576000 bytes transferred in 238.753937 secs (4391869 bytes/sec)
 +
root@:LC:1%
 
</PRE>
 
</PRE>

Revision as of 15:05, 8 May 2026

I frequently see Juniper EX2200 and EX3300 switches with faulty flash. If you need to recover or destroy some data from one, or are just looking to play with a dead switch, you can boot it from USB.

You will need a USB key that was created as a recovery disk from a working system. It may also be possible to flash it with a computer and Junos packages.

Insert the USB key and power on the switch.

Press Enter when you see this prompt:

Press Enter to stop auto bootsequencing and to enter loader prompt.

Check that you see two disks with the "lsdev" command:

loader> lsdev
disk devices:
        disk0 - USB storage device 0
        disk1 - USB storage device 1
net devices:
        net0:

Run the "show" command and look for the line that says

loader> show
LINES=24
baudrate=9600
boot.btsq.disable=0
boot.current=upgrade
(omittedfor brevity)
loaddev=disk0:
(omitted for brevity)

Set this to disk1: then save and reboot

loader> set loaddev=disk1:
loader> save
Saving environment to flash... done
loader> reboot
Resetting...

If your USB key has an activity LED, you should see it flashing while it boots.

If you're looking to destroy the data on the onboard flash, do it with the "dd" command. Note we booted from da1 and are zeroing da0.

root@:LC:1% cli
root> show system storage partitions
fpc1:
--------------------------------------------------------------------------
Boot Media: external (da1)
Active Partition: da1s2a
Backup Partition: da1s1a
Currently booted from: active (da1s2a)

Partitions information:
  Partition  Size   Mountpoint
  s1a        316M   altroot
  s2a        324M   /
  s3d        656M   /var/tmp
  s3e        224M   /var
  s4d        108M   /config

{linecard:1}
root> exit

root@:LC:1% ls /dev/da*
/dev/da0        /dev/da0s2c     /dev/da0s4c     /dev/da1s2      /dev/da1s3e
/dev/da0s1      /dev/da0s3      /dev/da0s4d     /dev/da1s2a     /dev/da1s4
/dev/da0s1a     /dev/da0s3c     /dev/da1        /dev/da1s2c     /dev/da1s4c
/dev/da0s1c     /dev/da0s3d     /dev/da1s1      /dev/da1s3      /dev/da1s4d
/dev/da0s2      /dev/da0s3e     /dev/da1s1a     /dev/da1s3c
/dev/da0s2a     /dev/da0s4      /dev/da1s1c     /dev/da1s3d
root@:LC:1% dd if=/dev/zero of=/dev/da0 bs=1M count=1100
dd: /dev/da0: end of device
1001+0 records in
1000+0 records out
1048576000 bytes transferred in 238.753937 secs (4391869 bytes/sec)
root@:LC:1%