Skip to content

Instantly share code, notes, and snippets.

@tonusoo
Created July 28, 2025 16:53
Show Gist options
  • Select an option

  • Save tonusoo/302846a53f305fff88636923003db093 to your computer and use it in GitHub Desktop.

Select an option

Save tonusoo/302846a53f305fff88636923003db093 to your computer and use it in GitHub Desktop.
"can't open '/boot/loader.rc': no such file or directory" error in vJunos-router
qemu-nbd --connect=/dev/nbd0 vJunos-router-23.2R1.15.qcow2
fdisk -l /dev/nbd0
mkdir -p /tmp/nbd0p2
mount -v /dev/nbd0p2 /tmp/nbd0p2
qemu-nbd --connect=/dev/nbd1 /tmp/nbd0p2/home/pfe/junos/junos-virtual-x86-64-23.2R1.15.qcow2
mkdir -p /tmp/nbd1p3
mount -t ufs -v -o ro,ufstype=44bsd /dev/nbd1p3 /tmp/nbd1p3
cp -v /tmp/nbd1p3/boot/loader.rc .
umount /tmp/nbd1p3
qemu-nbd --disconnect /dev/nbd1
qemu-nbd --connect=/dev/nbd1 /tmp/nbd0p2/home/pfe/junos/junos-hdd.img
# On Debian, the ufs.ko must be compiled with CONFIG_UFS_FS_WRITE=y
mount -t ufs -v -o rw,ufstype=44bsd /dev/nbd1p3 /tmp/nbd1p3
cp -v loader.rc /tmp/nbd1p3/boot/loader.rc
umount /tmp/nbd1p3
qemu-nbd --disconnect /dev/nbd1
umount /tmp/nbd0p2
qemu-nbd --disconnect /dev/nbd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment