Following are the simple instructions on how to mount Windows USB drive onto Centos/RHEL 7 and also resolve a very common mounting issue which presents itself with error: mount: unknown filesystem type ‘exfat’.
Before we can mount the USB drive, we need to first obtain its file system path. Run following command to do so:
fdisk -l
In the output, you need to look for your USB drive, I’ve found mine by SSD the disk size (120 GB) and SDB denominator.
Another, perhaps easier way to do this, is to run following command:
for devlink in /dev/disk/by-id/usb*; do readlink -f ${devlink}; done
It’ll output something like this:
mkdir /mnt/usb
And finally let’s mount the file system to /mnt/usb directory we’ve just created.
mount /dev/sdb1 /mnt/usb
Now your USB drive will be accessible by browsing to: /mnt/usb:
Note: it’ll automatically un-mount if you reboot your system.
If you want to un-mount manually, simple use:
umount /mnt/usb
If the drive is busy and above command won’t let you un-mount, you can forcefully unmount it by using this command:
umount -f /mnt/usb
—
Now, as far as dealing with error: mount: unknown filesystem type ‘exfat’.
You’ll most likely experience this error because you’re trying to mount a drive previously formatted under Windows OS.
To resolve the issue, you’ll need to install support for mounting EXFAT drives onto Linux. Do that by installing following two programs: exfat-utils and fuse-exfat
Normally, these are not present in Centos 7, so before you will run Yum Install command, you’ll first need to add li.nux.ro Epel repository to your system:
yum -y install epel-release && rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
Finally, you can install exfat support with this simple command:
yum install fuse-exfat exfat-utils
And once this is done, you can run above mounting procedure again – it’ll work without any errors.
Enjoy!