LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   user mounting of USB drive... (https://www.linuxquestions.org/questions/slackware-14/user-mounting-of-usb-drive-4175419425/)

Habitual 07-30-2012 03:36 PM

user mounting of USB drive...
 
I caught this thread on this same subject , but I don't want to hijack his thread and he's running 64 bit and I am not, so here it is...

I have tried several variations in my /etc/fstab, all result in "Sucks to be you" messages when trying to mount using Xfce right-click > "Mount Volume".

Here's the current (and (#)former) /etc/fstab entries:
Code:

#/dev/sdc1    /media/Keepers      ntfs-3g    defaults          0  0
#/dev/sdc1    /media/Keepers      ntfs-3g    noexec,users,nodev,rw 0 0
/dev/sdc1    /media/Keepers      ntfs-3g    defaults        1 2
#/dev/sdc1    /media/Keepers      ntfs-3g    noauto,user,rw 1 0

#/dev/sdc1 /media/Keepers ntfs-3g defaults 0 0
#/dev/sdc1 /media/Keepers ntfs-3g noexec,users,nodev,rw 0 0
/dev/sdc1 /media/Keepers ntfs-3g defaults 1 2
#/dev/sdc1 /media/Keepers ntfs-3g noauto,user,rw 1 0

Thank you,

JJ of c9

edit: I can Unmount the volume, but must use "sudo mount -a" to get it up using
Code:

/dev/sdc1        /media/Keepers          ntfs-3g    noexec,users,nodev,rw 0 0
in /etc/fstab.

Kustom42 07-30-2012 04:11 PM

So are you still having issues? You must run the command as sudo in order to mount it. Your last few lines indicate that you were able to mount it.

Habitual 07-30-2012 04:36 PM

I can mount as root and umount as user via Xfce > right-click.

Can users not mount these devices?

Thanks!

Kustom42 07-30-2012 05:00 PM

Users can not mount devices. Almost all distro's should come with some sort of automount process for these via udev. If it is not automatically mounted users should be able to call upon the command with udevtrigger. The slackwiki has a good page on udev you may want to read over.

natharran 07-30-2012 05:36 PM

Hi,

I see you're having the same issue I had. This is what I needed to do to solve it.

1) User must have a write access to the mount point (/media/Keepers) - so either make sure you have it or change the mount point. I guess that by default users are not permitted to write there.
2) User must be a member of "disk" group in order to access the media - see

Code:

ls -l /dev/sd*
3) Your /bin/ntfs-3g must have a setuid root, or it won't allow you to mount the devices. According to ChangeLog:

Quote:

Mon Jul 16 19:00:08 UTC 2012
a/ntfs-3g-2012.1.15-x86_64-2.txz: Rebuilt.
Made /bin/ntfs-3g setuid root, because otherwise it refuses to allow
non-root users to mount volumes now, even if /etc/fstab allows it.
Just run

Code:

su
chmod u+s /bin/ntfs-3g

And it should work. Btw, you don't need to specify the "noexec nodev" in your fstab, the "user" or "users" already implies that - see

Code:

man mount

natharran 07-30-2012 05:52 PM

Quote:

Originally Posted by Habitual (Post 4741635)
I can mount as root and umount as user via Xfce > right-click.

Can users not mount these devices?

Thanks!

You can umount the device as user because that's done via fusermount. To mount ntfs as a user, however, you need to use the ntfs-3g that now needs a setuid root - see above. I was also confused by this.

Habitual 07-30-2012 08:42 PM

Thanks to everyone, I got it sorted out.

  1. Added myself to disk group.
  2. chown root:disk /media/Keepers
  3. su
  4. chmod u+s /bin/ntfs-3g
  5. Logout|in.
/etc/fstab:
Code:

/dev/sdc1    /media/Keepers      ntfs-3g    users,rw    0 0
mounted with "sudo mount -a" and I can umount and remount it, so it's all gooood.

Done.


All times are GMT -5. The time now is 04:03 PM.