4

I have ntfs-3g installed, and use this udev rule to auto mount external drives automatically. When I try umount it as non-root, it says:

umount: /media/umm is not in the fstab (and you are not root)

The device mounts as:

/dev/sdc1  fuseblk    150G  143G  6.6G  96% /media/umm

and is part of the users group. I did a chkdsk on a Windows machine to ensure no file system errors.

Any ideas?

(personally I'd prefer not to use ntfs, but I need it for sharing with all the non-UNIX systems and allow for files > 4GB).

invert
  • 1,763

2 Answers2

3

This is how the system is designed.

Since the filesystem is being mounted by root and it's not listed in /etc/fstab with the user option, only root can unmount it. You can't change this behavior.

What you can do is to modify your script to mount it in a location you own as your user. You'll also need to make the block device readable/writable by you.

That would be to change this:

ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"

To this:

ACTION=="add", RUN+="/bin/chown invert:invert /dev/%k", RUN+="sudo -u invert /bin/mkdir -p /home/invert/media/%E{dir_name}", RUN+="sudo -u invert /bin/mount -o $env{mount_options} /dev/%k /home/invert/media/%E{dir_name}"

Giving users direct read/write access to block devices is not something to be encouraged, but if this is only your workstation the reduction in security is probably negligible.

bahamat
  • 39,666
  • 4
  • 75
  • 104
0

If you are using ubuntu, I think using disk utility (actually made by RedHat) will do it just fine

tr33hous
  • 263