In this blog article, I’ll show you how to mount a USB Flash Drive on CentOS 7 terminal. In my case, I needed to mount a USB Flash Drive on my minimal CentOS 7 machine to copy a file to the USB Flash Drive.
USB Flash Drive
The file system of my USB flash drive is FAT32. I used a Windows 10 computer to create a folder called
System Volume Information on the USB flash drive.
First, go to your CentOS 7 computer and create a folder where you’ll mount the contents of the USB flash drive to.
mkdir -p /media/USB
/dev is a location that represents devices attached to your computer. Check the
/dev directory’s contents by typing:
ls /dev/sd (then hit tab)
You should see something like this:
Next, insert your USB flash drive into the CentOS 7 machine. Type
ls /dev/sd (then hit tab). You should see a new
Our USB flash drive is represented by
/dev/sdb1. We will mount the USB flash drive to the
/media/USB folder that we created earlier.
mount -t vfat /dev/sdb1 /media/USB
Check if the USB flash drive is mounted by listing the contents of
[root@buhpc6 ~]# ls /media/USB System Volume Information
System Volume Information, I know that the USB flash drive was mounted properly. Now, I can copy any file to the mounted USB flash drive folder.
cp nfs-utils-1.3.0-0.21.el7_2.x86_64.rpm /media/USB/
After you are done with the USB flash drive, always remember to unmount the USB flash drive from the folder it is mounted on.
You can now safely eject the USB flash drive from the CentOS 7 machine.