lsblk -f # find the device and its filesystem
sudo mkdir -p /mnt/usb
sudo mount /dev/sdg1 /mnt/usb
sudo umount /mnt/usb
findmnt # what is mounted where
Ownership and permissions on FAT/NTFS/exFAT¶
These filesystems have no Unix owners or modes, so the mount options decide who can write:
sudo mount -o rw,uid=2001,gid=2001,umask=000 /dev/sdg1 /tmp/music
uid and gid set the owner and group of every file. umask=000 yields mode 777. That is permissive: use umask=022 or umask=002 with a real group if others share the machine.
Handy variants¶
sudo mount -o ro /dev/sdc1 /mnt/rescue # read-only (forensics, failing disks)
sudo mount -o loop image.iso /mnt/iso # mount a file
sudo mount --bind /src/dir /dst/dir # make a directory appear elsewhere
sudo mount -o remount,rw / # change options of a mounted filesystem
Make a mount permanent in /etc/fstab, preferring stable identifiers (UUID=... from blkid) over /dev/sdX names, which can change between boots. Test edits with sudo mount -a before rebooting.