My flash drive is recognized.
Code:
$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.6G 5.1M 1.6G 1% /run
/dev/sda6 53G 30G 24G 56% /
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 5.0M 8.0K 5.0M 1% /run/lock
/dev/sda5 834G 232G 560G 30% /home
tmpfs 1.6G 228K 1.6G 1% /run/user/1000
/dev/sdb1 58G 24K 55G 1% /media/daryl/2615fa0f-e5b9-4b84-90b1-f78279a3e51f
I tried to give myself permission with
Code:
$ sudo mount /dev/sdb1
[sudo] password for daryl:
mount: /dev/sdb1: can't find in /etc/fstab.
Am I required to enter a removable drive into fstab to get it to mount on insertion?
If you just want to mount the usb to read it, you need to add a mount point to the command, e.g.:
Code:
sudo mount /dev/sdb1 /mnt
Then navigate to /mnt and run
ls
to see the files.
If you want to write to the usb, then the following command will enable that:
Code:
sudo mount /dev/sdb1 /mnt -o umask=0
If you want to have the usb mounted automatically on insertion, then desktop environments like gnome and kde have settings where you can select automounting to occur on insertion of the usb. The configs will be under Settings somewhere.
One is not required to have an entry in /etc/fstab to have the usb mounted on insertion.
Having an entry in /etc/fstab to mount a usb can be limiting because the device name in the fstab file may not correspond with the device name the kernel allocates to the device, in which case it won't get mounted.
If on the other hand, you only ever plug in a single usb at a time, which the kernel always allocates the same device name, then an entry in /etc/fstab with that device name or the associated UUID usually works reliably with the following sort of entry:
Code:
/dev/sdb1 /media/usb vfat defaults,noauto,user 0 0
The mount point in this example is /media/usb, and it has to exist on the filesystem.
The "noauto" means that the usb won't be mounted automatically on boot. The following command should then mount the usb whenever it's inserted:
There would be no need for the sudo privilege shown in post #1. To unmount, either of the following should work:
Code:
umount /dev/sdb1
umount /media/usb
An alternative means of mounting is to use the udisks2 facilities which enable reading and writing to the usb. For example, in the following, the user checks the device name, then uses the commands shown to mount and unmount the usb:
Code:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 1 14.6G 0 disk
└─sda1 8:1 1 14.6G 0 part <-----------DEVICE NAME is /dev/sda1
sr0 11:0 1 1024M 0 rom
<snip>
Mount the usb:
Code:
$ udisksctl mount -b /dev/sda1
Mounted /dev/sda1 at /media/ben/STORE N GO
List the files at the mount point:
Code:
$ cd /media/ben/STORE N GO
$ ls
file1 file2 file3
<snip>
To unmount the usb:
Code:
udisksctl unmount -b /dev/sda1
To unmount successfully, the user has to leave the directory where the usb is mounted.
The packages installed on a machine here related to this are:
udisks2
fuse3
gvfs-fuse
libfuse2t64
libfuse3-3
The user is a member of the disk and plugdev groups in /etc/group. Haven't checked without those configs.