Description

This article details the procedure to perform recovery installation on Juniper Networks QFX5K/EX4600 Series Switches by using an emergency boot device such as a USB. 

Symptoms

If Junos OS on your device is damaged or corrupted in some way that prevents the software from loading correctly, you may need to perform a recovery installation by using an emergency boot device. 

Solution

Perform the following steps:

  1. Download the required Install Media (.img) file from the Downloads page.

  2. Create an emergency boot device:

From the Junos OS shell or a Linux terminal: dd if= <LOCATION> / <junos-install-media> of=/dev/ <Device Name> bs= <n> m

  • For example: root@QFX5110% dd if=/var/tmp/install-media-host-usb-qfx-5e-x86-64-17.2R2.8-secure.img of=/dev/da0 bs=16m

​Alternatively, you can also use GUI-based tools such as Rufus or ISO Burner for Windows or Etcher for Mac.

  1. Insert the USB into the QFX switch and reboot the switch from the CLI by using "request system reboot hypervisor at now". Alternatively, you can power cycle the switch. 

  2. Press the Esc key as soon as the device reboots. Go to Boot Manager and from the Boot Options menu, select the USB Device. Then select the Install Juniper Linux with secure boot support option.

  3. When the installation is complete, the switch will boot up with a factory default configuration. Remove the USB device from the switch and set up the device or load the required configuration.

Example

root@QFX5110> request system reboot hypervisor at now
Reboot the system at now? [yes,no] (no) yes
*** FINAL System shutdown message from root@QFX5110 ***
 
System going down IMMEDIATELY
 
Stopping cron.
Waiting for PIDS: 5021.
Poweroff for hypervisor to respawn
Oct 30 11:23:36 jlaunchd: periodic-packet-services (PID 4959) terminate signal 15 sent
Oct 30 11:23:36 jlaunchd: secure-neighbor-discovery (PID 4974) terminate signal 15 sent
Oct 30 11:23:36 jlaunchd: shm-rtsdbd (PID 4975) terminate signal 15 sent
Oct 30 11:23:36 jlaunchd: subscriber-management (PID 4976) terminate signal 15 sent
Oct 30 11:23:36 jlaunchd: ntp (PID 4977) terminate signal 15 sent
Oct 30 11:23:36 jlaunchd: snmp (PID 4978) terminate signal 15 sent
Oct 30 11:23:40 jlaunchd: dynamic-flow-capture (PID 4971) exited with status=0 Normal Exit
Oct 30 11:23:40 jlaunchd: app-engine-management-service (PID 4356) exited with status=0 Normal Exit
Oct 30 11:23:40 jlaunchd: tnp-process (PID 4340) exited with status=0 Normal Exit
Waiting (max 60 seconds) for system process `vnlru' to stop...done
Waiting (max 60 seconds) for system process `bufdaemon' to stop...done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining...2 2 2 1 0 0 0 0 done
All buffers synced.
Uptime: 3d16h2m9s
usbus0: controller did not stop
unloading fpga driver
Khelp module "jsocket" can't unload until its refcount drops from 6 to 0.
acpi0: Powering system off
INIT: Switching to runlevel: 6
INIT: Sending processes the TERM signal
stopping rsyslogd ... done
Stopping OpenBSD Secure Shell server: sshdstopped /usr/sbin/sshd (pid 1623)
.
Stopping atd: OK
Stopping domain name service: named.
Unmounting cgroups...Done
Stopping system message bus: dbus.
stopping DNS forwarder and DHCP server: dnsmasq... stopped /usr/bin/dnsmasq (pid 3620 3619)
done.
Shutting down irqbalance: no irqbalance found; none killed
done
stopping rsyslogd ... done
Stopping internet superserver: xinetd.
 
Waiting for sanlock to stop:^[ Success
 
udevd[1196]: can not find '/etc/udev/rules.d/81-i40e-udevhelper.rules': No such file or directory
 
Clearing ebtables rulesets: filter nat broute done. ok
Stopping crond: OK
Stopping S.M.A.R.T. daemon: smartd.
Stopping network management services:snmpd[1795]: Received TERM or STOP signal...  shutting down...
 
snmpd snmptrapdstopped libvirtMib_subagent (pid 1798)
libvirtMib_subagent.
* Stopping virtualization library daemon: libvirtd                      [ ok ]
Deconfiguring network interfaces... done.
Stopping tcsd: ^[OK
Sending all processes the TERM signal...
Sending all processes the KILL signal...
Unmounting remote filesystems...
Deactivating swap...
Unmounting local filesystems...
Rebooting... RE-FPGA-DRV: reboot notifier called with 0x0001
RE-FPGA-DRV: Please standby while rebooting.
.
..
..
..
..U
Esc is pressed. Go to boot options.
 
 
 
Continue                                             This selection will take
Boot Manager                                         you to Boot Manager.
Device Manager
Setup Utility

 
 
/------------------------------------------------------------------------------\
|                                Boot Manager                                  |
\------------------------------------------------------------------------------/
 
Boot Option Menu
 
EFI HDD Device (TS32ZBTDE1500)
EFI USB Device (Unigen  PQS4000)
 
^ and v to change option, ENTER to select an option, ESC to exit
 

Now booting : EFI USB Device (Unigen  PQS4000)
Welcome to GRUB!
 
Secure Grub2 Diskboot
 
                     GNU GRUB  version 2.02~juniper/rel_v3~
 
/----------------------------------------------------------------------------\
| Reboot                                                                     |
|*Install Juniper Linux with secure boot support                             |
| Boot to host shell                                                         |
|                                                                            |
|                                                                            |
|                                                                            |
|                                                                            |
|                                                                            |
|                                                                            |
|                                                                            |
|                                                                            |
|                                                                            |
\----------------------------------------------------------------------------/
 
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, `e' to edit the commands
      before booting or `c' for a command-line. ESC to return previous
      menu.
 

Loading Linux ...

** For QFX5k devices with Junos OS Evolved version:

After GNU GRUB starts the installation automatically, Issue the reboot command to finish the installation.

 

Format5.jpg



**Selecting the wrong booting device**

If by mistake the USB flash drive is selected from the boot manager, this will lead the switch to a freeze boot sequence. 



It will freeze here:




If you start over, attempt the procedure a second time but this time you select the appropriate booting device ( EFI USB device), the format will be completed, but future reboots will take you to the booting menu, and it will be stuck until you manually select "EFI HDD Device (TS32GMTS402M-ACC)" for the boot process to be completed every time.



Solution:

1- Power cycle the switch and get back to the booting menu using the Esc key. 

2- Choose: setup utility, then use the ">" to get to the left where it says boot.

3- Changed the boot settings to boot from EFI HDD, enabling it by hitting enter.

4- SSD 0 and SSD 1 both need to be disabled.

5- Exit, save changes.

E.g.

After this, the switch should boot without manual intervention.

Note: If any of the above procedures don't yield the expected results, contact Support to open a Technical Support case.

 

Modification History

2024-01-31: Added QFX5220 format install steps.
2023-02-24: Corrected minor error on the command example.