Description

This article provides a work-around for the error, usb media missing or invalid , when running the request system snapshot command.

This issue is applicable to PPC based platforms, e.g. MX5, MX10, MX40, MX80 and MX104.

Symptoms

When there is a need to deploy quickly a customized Junos image on several MX80 or MX104 routers, a USB disk can be used to achieve this purpose. The USB device contains a backup image previously created on the source router using the command ' request system snapshot media usb '.

Following is a description of the procedure.

  1. ​Use the USB disk to bootup the new router.
  2. Perform ' request system snapshot ' on the newly booted router to copy the USB image onto the alternate media (nandflash 1).
  3. Unplug the USB stick.
  4. Boot the router from the alternate media (nandflash1).
  5. Execute ' request system snapshot ' to create a backup image on nandflash0.
  6. Reboot the router.

Due to a  known platform limitation, step 4 will fail to complete properly on the MX80, and the following error message might be reported:

> request system snapshot 
error: usb media missing or invalid

Solution

The procedure fails because the /etc/fstab file has /altroot and /altconfig mountpoints pointing to the USB device.

% cat /etc/fstab
 #version 3
 # Device       Mountpoint  FStype  Options  Dump  Pass#
 /dev/da1s1a    /           ufs     rw        1    1
 /dev/da1s1e    /config     ufs     rw        2    2
 proc           /proc       procfs  rw        0    0
 /dev/da1s1f    /var        ufs     rw,noauto 2    2
 /dev/da0s1b    none       swap    sw        0    0
 /dev/da1s1b    /tmp        mfs     rw,noauto 0    0
 /dev/da1s1b    /mfs        mfs     rw,noauto 0    0
 /dev/da2s1a    /altroot    ufs     rw,noauto 2    0     <-- USB device
 /dev/da2s1e    /altconfig  ufs     rw,noauto 2    0  

A workaround to resolve this issue is through editing /etc/fstab and adding the correct mountpoints manually, after step 4 above:

>start shell user root

Then add these two commands:

 # sed -i.bak1 's/da2s1a/da0s1a/g' /etc/fstab
 # sed -i.bak2 's/da2s1e/da0s1e/g' /etc/fstab

After performing the above changes, /etc/fstab will look as follows:​

% cat /etc/fstab
 #version 3
 # Device       Mountpoint  FStype  Options  Dump  Pass#
 /dev/da1s1a    /           ufs     rw        1    1
 /dev/da1s1e    /config     ufs     rw        2    2
 proc           /proc       procfs  rw        0    0
 /dev/da1s1f    /var        ufs     rw,noauto 2    2
 /dev/da0s1b    none       swap    sw        0    0
 /dev/da1s1b    /tmp        mfs     rw,noauto 0    0
 /dev/da1s1b    /mfs        mfs     rw,noauto 0    0
 /dev/da0s1a    /altroot    ufs     rw,noauto 2    0
 /dev/da0s1e    /altconfig  ufs     rw,noauto 2    0

Then request system snapshot will be executed properly without errors.

> request system snapshot
 Doing the initial labeling...
 Verifying compatibility of destination media partitions...
 Running newfs (899MB) on internal media  / partition (da0s1a)...
 Running newfs (99MB) on internal media  /config partition (da0s1e)...
 Copying '/dev/da1s1a' to '/dev/da0s1a' .. (this may take a few minutes)
 Copying '/dev/da1s1e' to '/dev/da0s1e' .. (this may take a few minutes)
 The following filesystems were archived: / /config