This article outlines a problem that can occur when doing a format install on the EX Series switch, resulting in the error "cannot open package". The condition is found to be due to the password file not being created properly.
When trying to do a format install on an EX switch from loader, the problematic device may show the following error conditions:
loader> install tftp://10.10.10.10/jinstall-ex-4300-13.2X50-D18-domestic-signed.tgz
cannot open package (error 60)
loader> install --format tftp://10.10.10.10/jinstall-ex-4300-13.2X50-D18-domestic-signed.tgz
cannot open package (error 60)
loader> install file:///jinstall-ex-4300-13.2X50-D18-domestic-signed.tgz
cannot open package (error 22)
The device may have gotten into a problematic state where the password files were not created properly. This could have been the result of multiple power cycles on the device to recover the device.
In general, after password recovery, it is recommended to do a system snapshot so that both partitions have the same Junos OS release.
The following procedure will recover the password file and correct this problem.
-
Get into "single user mode" during the boot cycle by first getting to the loader prompt. To get to the loader prompt, press the space bar when you see "Loading /boot/defaults/loader.conf
," during the beginning of the boot cycle.
loader> boot -s
-
Check and mount the /var
file system.
# df
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/da0s1a 647748 349172 246760 59% /
devfs 2 2 0 100% /dev
/dev/md0 436012 436012 0 100% /packages/mnt/junos
# mount /dev/da0s3e /var
WARNING: /var was not properly dismounted
# df
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/da0s1a 647748 349172 246760 59% /
devfs 2 2 0 100% /dev
/dev/md0 436012 436012 0 100% /packages/mnt/junos
/dev/da0s3e 347504 13932 305772 4% /var <===da0s3e mounted
-
Check the password files in the root
directory.
# ls -lrt /var/etcroot
- Create read-write access to the root partition and create the symbolic links to the password files.
# mount -uw /
# ln -s /var/etcroot/spwd.db /etc/spwd.db
# ln -s /var/etcroot/pwd.db /etc/pwd.db
-
Unmount the /var
partition.
# cd /
# umount /var
# df
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/da0s1a 647748 349172 246760 59% /
devfs 2 2 0 100% /dev
/dev/md0 436012 436012 0 100% /packages/mnt/junos
# exit
-
This will boot the EX4300 device into amnesiac mode from where you can log in to the device using the root
username.
Amnesiac (ttyu0)
login: root
Logging to master
root>
2020-04-28: Article checked for accuracy; article found to be valid and relevant; minor changes made