Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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).

share|improve this question

2 Answers 2

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.

share|improve this answer
    
I'm happy to do this on my personal netbook. I will try this out. Thank you! –  invert Jul 30 '12 at 7:56

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

share|improve this answer
    
I do not have disk utility on Crunchbang Linux, I would prefer a more cross-distro solution please. –  invert Jul 30 '12 at 7:48
    
k. sorry, not sure how to without using this tool. –  tr33hous Jul 30 '12 at 7:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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