External drive mounts only as root

I'm having trouble with a USB drive. It used to automount just fine but for some reason those good old days are over. Not only does it not automount but mounting it as a regular user from Nautilus or the terminal gets me a

You do not have the permissions necessary to view the contents of “Elements”.

I can totally mount it as root with

sudo mount -t ntfs-3g /dev/sdb1 /media/Elements

I suspected (and still do) a problem with permissions and, even though Nautilus gave them as being r+w for my user, the admin group, and others, changed them to:

cd /media/Elements
sudo chown -R -v sarah:sarah

which propped up my hopes as the whole output was similar to

changed ownership of 'Volumes' from root:root to sarah:sarah

... but no. Still can't mount unless I sudo mount.

Here's the fstab content:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda4 during installation
UUID=9a4ff421-d5ab-4d26-a635-f9fd111d7eec /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=67E3-17ED  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda5 during installation
UUID=bbf1370f-c5c6-4398-b8ef-7d6092450df8 none            swap    sw              0       0

The disks look like this for fdisk -l ; ls -l /dev/disk/by-uuid/

Device         Start       End   Sectors   Size Type
/dev/sda1         40    409639    409600   200M EFI System
/dev/sda2     409640 488746431 488336792 232,9G Apple HFS/HFS+
/dev/sda3  488746432 490015967   1269536 619,9M Apple boot
/dev/sda4  490016768 968577023 478560256 228,2G Linux filesystem
/dev/sda5  968577024 976771071   8194048   3,9G Linux swap

Disk /dev/sdb: 931,5 GiB, 1000170586112 bytes, 1953458176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa635339d

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1        2048 1953458175 1953456128 931,5G  7 HPFS/NTFS/exFAT

total 0
lrwxrwxrwx 1 root root 10 maj  8 20:26 072d92f8-9fe6-3e97-8dc8-b974961cd0ea -> ../../sda2
lrwxrwxrwx 1 root root 10 maj  8 20:26 67E3-17ED -> ../../sda1
lrwxrwxrwx 1 root root 10 maj  8 20:26 876e8119-57e2-37e2-bc4a-2a1ddc3d4de4 -> ../../sda3
lrwxrwxrwx 1 root root 10 maj  8 22:35 9092472B924714DE -> ../../sdb1
lrwxrwxrwx 1 root root 10 maj  8 20:26 9a4ff421-d5ab-4d26-a635-f9fd111d7eec -> ../../sda4
lrwxrwxrwx 1 root root 10 maj  8 20:26 bbf1370f-c5c6-4398-b8ef-7d6092450df8 -> ../../sda5

Any ideas?


Solution 1:

you need to add user option to your fstab (/etc/fstab) like this

/dev/sdc1    /media/sdc1     vfat  uid=1000,noauto,user           0  0  
/dev/sdd1    /media/sdd1     vfat  uid=1000,noauto,user           0  0  
/dev/sdb1    /media/sdb1     vfat  uid=1000,noauto,user           0  0

Normally, only the superuser can mount filesystems. However, when fstab contains the user option on a line, anybody can mount the corresponding system.

Or if you want any user to mount/unmount the drives use users instead:

/dev/sdc1    /media/sdc1     vfat  uid=1000,noauto,users           0  0  
/dev/sdd1    /media/sdd1     vfat  uid=1000,noauto,users           0  0  
/dev/sdb1    /media/sdb1     vfat  uid=1000,noauto,users           0  0

Only the user that mounted a filesystem can unmount it again. If any user should be able to unmount, then use users instead of user in the fstab line.

Further reading: Fstab - Ubuntu Documentation

NOTE - Find original answer here by Braiam

Solution 2:

Ok, I got it. All of the above did not work but I noticed that /media/username was also out of bounds, which was really weird as as was logged in as username. I guess it all has to do with changing the UID a while back. Anyhow, deleting /media/username let it be recreated automatically upon the next plug-in with the right permissions.

Solution 3:

Try this:

Unplugg the usb

Open a terminal:

Press Ctrl+Alt+T

Run it:

exec sudo -i
mkdir /media/Elements
chown -R -v sarah:sarah /media/Elements
chmod -Rf 777 /media/Elements