Dell Networking SONiC Firmware version 3.x, 4.0.0 How to Mount USB and copy file between switch and USB

Summary: This article explains how to mount USB and copy file between switch and USB in Dell Networking SONiC version 3.x, 4.0.0

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

This article is applicable for the following releases
3.0, 3.1, 3.2 3.3, 3.4, 3.5, 4.0.0
 
For 4.0.1 and above firmware click below link
Dell Networking SONiC How to mount and unmount USB
 


Command Syntax

 
Command  Explanation
admin@sonic:~$ sudo blkid Check the USB device drive location (Mostly it will be /dev/sdb or /dev/sdb1)
admin@sonic:~$ sudo mkdir /mnt/usb Create the USB mount location /mnt/usb.
admin@sonic:~$ sudo mount <USB device drive location> /mnt/usb       Mount the USB drive to the USB mount directory /mnt/usb. 
admin@sonic:~$ sudo umount /mnt/usb Unmount USB
 

Sample Output


In the below example, the USB is located in /dev/sdb. (Output Trimmed for brevity)
admin@sonic:~$ sudo blkid
/dev/sda1: SEC_TYPE="msdos" LABEL_FATBOOT="EFI System" LABEL="EFI System" UUID="XXXXXXXXXXXXXXXXXXXXXX" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="XXXXXXXXXXXXXXXXXXXXXX"
/dev/sda2: LABEL="ONIE-BOOT" UUID="XXXXXXXXXXXXXXXXXXXXXX" TYPE="ext4" PARTLABEL="ONIE-BOOT" PARTUUID="XXXXXXXXXXXXXXXXXXXXXX"
/dev/sda3: LABEL="SONiC-OS" UUID="XXXXXXXXXXXXXXXXXXXXXX" TYPE="ext4" PARTLABEL="SONiC-OS" PARTUUID="XXXXXXXXXXXXXXXXXXXXXX"
/dev/loop0: TYPE="XXXXXXXXXXXXXXXXXXXXXX"
/dev/loop1: UUID="XXXXXXXXXXXXXXXXXXXXXX" TYPE="ext4"
/dev/loop2: UUID="XXXXXXXXXXXXXXXXXXXXXX" TYPE="ext4"
/dev/sdb: LABEL="USB" UUID="XXXXXXXXXXXXXXXXXXXXXX" TYPE="vfat"
/dev/ramdisk: UUID="XXXXXXXXXXXXXXXXXXXXXX" TYPE="ext4

Create /mnt/usb directory and mount the USB in the directory. 
admin@sonic:~$ sudo mkdir /mnt/usb
admin@sonic:~$ sudo mount /dev/sdb /mnt/usb
 
To Unmount usb
admin@sonic:~$ sudo umount /mnt/usb
 

Copy File to and from a USB Drive Inserted in the Switch

Use cp command to copy a file from/to the mounted directory.

For example, in the below output, we are copying the show tech file (sonic_dump_sonic_20230520_013638) in /var/dump to /mnt/usb directory.
 
admin@sonic:~$ sudo cp /var/dump/sonic_dump_N3248TE-Sonic-Leaf42_20230520_013638.tar /mnt/usb/

Affected Products

Enterprise SONiC Distribution, PowerSwitch E3200-ON Series, Dell EMC Networking N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON , PowerSwitch Z9432F-ON ...
Article Properties
Article Number: 000213916
Article Type: How To
Last Modified: 25 May 2023
Version:  3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.