documents/dev/Unix mount exFat.md

Unix Mount exFat

Install exFat support sudo apt-get install exfat-fuse exfat-utils

create a folder to mount drive to sudo mkdir /media/dominick/my_drive_name

Listing Drives

list the drives to mount, note device (/dev/sdb_)

  • sudo fdisk -l
  • SamsungT5 sudo fdisk -l | grep 465.8G
  • Passport sudo fdisk -l | grep 931.5G

Use

  • df -kh
  • df -kh | grep 466G SamsungT5
  • df -kh | grep 932G Passport

Mounting Drive

sudo mount -t exfat /dev/sdb_ /media/dominick/my_drive_name -o uid=1000

-o is security options, uid=1000 is current user

unmount sudo umount /dev/sdb_

Automount https://www.techrepublic.com/article/how-to-properly-automount-a-drive-in-ubuntu-linux/ sudo blkid to get UUID sudo mkdir /media/dominick/mydrive to create mount point sudo vi /etc/fstab UUID=14D82C19D82BF81E /media/dominick/mydrive auto nosuid,nodev,nofail,x-gvfs-show 0 0 Breaking that line down, we have:

  • UUID=14D82C19D82BF81E - is the UUID of the drive. You don't have to use the UUID here. You could just use /dev/sdj, but it's always safer to use the UUID as that will never change (whereas the device name could).
  • /media/dominick/mydrive - is the mount point for the device.
  • auto - automatically determine the file system
  • nosuid - specifies that the filesystem cannot contain set userid files. This prevents root escalation and other security issues.
  • nodev - specifies that the filesystem cannot contain special devices (to prevent access to random device hardware).
  • nofail - removes the errorcheck.
  • x-gvfs-show - show the mount option in the file manager. If this is on a GUI-less server, this option won't be necessary.
  • 0 - determines which filesystems need to be dumped (0 is the default).
  • 0 - determine the order in which filesystem checks are done at boot time (0 is the default).