This article explains how to mount a USB drive on an ACX5448 device and copy files from it. This article also provides the steps to copy files from vmhost to Junos.
The following procedure allows users to mount a USB device on an ACX5448 device. This can be helpful if network connectivity is unavailable and you need to copy files to or from the device.
Enter the shell as root:
user@router> start shell user root Password: root@router:/var/home/labroot # vhclient -s Last login: day Month date <timestamp> from router on pts/2 root@router-node:~#
Before inserting the USB device, perform the following:
root@router-node:~# ls /dev/sd* /dev/sda /dev/sda2 /dev/sda4 /dev/sda6 /dev/sdb1 /dev/sdb3 /dev/sdb5 /dev/sdc /dev/sda1 /dev/sda3 /dev/sda5 /dev/sdb /dev/sdb2 /dev/sdb4 /dev/sdb6
Insert the USB drive in the USB port. The following output provides info of USB attach:
root@router-node:~# dmesg | tail [ 493.244240] scsi 6:0:0:0: Direct-Access JetFlash Transcend 16GB 1100 PQ: 0 ANSI: 6 [ 493.244468] sd 6:0:0:0: Attached scsi generic sg2 type 0 [ 493.245149] sd 6:0:0:0: [sdc] 30197760 512-byte logical blocks: (15.5 GB/14.4 GiB) [ 493.245876] sd 6:0:0:0: [sdc] Write Protect is off [ 493.245879] sd 6:0:0:0: [sdc] Mode Sense: 43 00 00 00 [ 493.246653] sd 6:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 493.251845] sdc: sdc1 <<<<<< location [ 493.254346] sd 6:0:0:0: [sdc] Attached SCSI removable disk <-- USB root@router-node:~# ls /dev/sd* /dev/sda /dev/sda2 /dev/sda4 /dev/sda6 /dev/sdb1 /dev/sdb3 /dev/sdb5 /dev/sdc /dev/sda1 /dev/sda3 /dev/sda5 /dev/sdb /dev/sdb2 /dev/sdb4 /dev/sdb6 /dev/sdc1
Create a directory for the USB drive to mount to:
root@router-node:~# mkdir /var/tmp/usb
Mount the USB drive to the /var/tmp/usb directory:
root@router-node::~# mount /dev/sdc1 /var/tmp/usb/
Check the USB files after mounting the USB:
root@router-node: ls /var/tmp/usb System Volume Information images.tgz <--- USB files
Note: 'ls /var/tmp/usb' will show all the files in the USB drive.
Copy any of the USB files to the /var/tmp/usb directory:
root@router-node: cp /var/tmp/usb/images.tgz /var/tmp root@router-node: ls /var/tmp images.tgz
The images.tgz file from the USB is successfully copied to the /var/tmp directory.
To move the file from vmhost to Junos, copy the files to /var/log or /var/crash in vhclient:
root@router-node:~# cp /var/tmp/images.tgz /var/crash/ root@router-node:~# ls -l /var/crash/images.tgz -rw------- 1 root root 2881405 <timestamp> /var/crash/images.tgz root@router-node:~# exit logout rlogin: connection closed root@router:/var/home/labroot # cli
Now logged into CLI mode, use the following command to copy files from vmhost to Junos:
user@router> request vmhost file-copy crash from-jnode images.tgz to-vjunos /var/tmp/images.tgz user@router> file list /var/tmp/images.tgz /var/tmp/images.tgz user@router> file list /var/tmp/images.tgz detail -rw------- 1 root wheel 2881405 <timestamp> /var/tmp/images.tgz total files: 1
Unmount the USB drive after the file is completely copied:
user@router> start shell user root Password: root@router:/var/home/labroot # vhclient -s Last login: day Month date <timestamp> from router on pts/2 root@router-node:~# root@router-node: umount /var/tmp/usb