1

Is there a way I can automount this USB drive so that I don't need to have root privileges to delete files?

This is what I currently have in my fstab file:

/dev/sdb1 /mnt/epson auto defaults,user,exec,umask=777 0 0

When I try to delete a file in the /mnt/epson folder:

$:/mnt/epson/EPSCAN/001$ rm EPSON004.PDF
rm: remove write-protected regular file ‘EPSON004.PDF’? y
rm: cannot remove ‘EPSON004.PDF’: Permission denied

If I run as sudo I can delete the file. I would like to grant any user to delete the files on the USB drive, as it is a USB stick plugged into an Epson WorkForce 840 printer and I am sharing the scans via this mounted drive. My backup solution is to schedule a chron job to clear out the folder periodically, however I would like to allow users to delete the files.

The same goes for any actions in the folder, and I cannot change the ownership either:

/mnt$ sudo chown user:user -R epson
chown: changing ownership of ‘epson/EPSCAN/001/test’: Operation not permitted
chown: changing ownership of ‘epson/EPSCAN/001/EPSON004.PDF’: Operation not permitted
chown: changing ownership of ‘epson/EPSCAN/001/EPSON005.PDF’: Operation not permitted
chown: changing ownership of ‘epson/EPSCAN/001/EPSON006.PDF’: Operation not permitted
chown: changing ownership of ‘epson/EPSCAN/001’: Operation not permitted
chown: changing ownership of ‘epson/EPSCAN’: Operation not permitted
chown: changing ownership of ‘epson’: Operation not permitted

EDIT:

Problem solved:

Problem solved, here is my fstab file:

/dev/sdb1 /mnt/epson vfat user,umask=0000,iocharset=utf8 0 0

http://ubuntuforums.org/showthread.php?t=1156286

2

Your problem is here:

/dev/sdb1 /mnt/epson auto defaults,user,exec,umask=777 0 0

That only means that the user is capable to mount (in fact, root will be always capable to mount, so you are not changing anything), but what you where looking for was user_id=0,group_id=0,default_permissions.

Add that to your fstab line, through I prefer something more complete:

/dev/sdb1 /mnt/epson auto defaults,user,exec,umask=777,rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other 0 0

The extra is allow_other that allows other users than the one doing the actual mounting to access the mounted filesystem.

  • Tried this and did not work, still getting permission denied. My understanding is that the user flag allows any user to mount, which was true. When I removed that I had to mount as sudo, before I could simply type mount /mnt/epson. Without user: mount: only root can mount /dev/sdb1 on /mnt/epson, with user: it mounts – Jens Bodal May 7 '14 at 2:18
  • Thank you for the help, unfortunately still getting permission denied. Here is my fstab file: /dev/sdb1 /mnt/epson auto allow_other,user_id=0,group_id=0,default_permissions 0 0 Again I am able to delete the file if doing so as sudo – Jens Bodal May 7 '14 at 2:23
  • I just redid again. I am unmounting with sudo umount -l /mnt/epson and remounting with mount /mnt/epson or when necessary sudo /mnt/epson -- here is the output from mount from your latest, still getting denied permissions: /dev/sdb1 on /mnt/epson type vfat (rw,nosuid,nodev,relatime,umask=777,user_id=0,group_id=0,default_permissions,allow_other,user=spiadmin). My guess is this problem is being exasperated by whatever the print is doing to the USB drive, however it seems odd I can remove files if sudoed – Jens Bodal May 7 '14 at 2:27
  • I just mounted a vfat usb stick, this is what it came: rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=utf8,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2. I don't see the difference between mine and yours. Try using this verbatim sans the uhelper=udisks2 thingy. – Braiam May 7 '14 at 2:45
  • Thank you for all the help, here's what fixed it: /dev/sdb1 /mnt/epson vfat user,umask=0000,iocharset=utf8 0 0 – Jens Bodal May 7 '14 at 5:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.