How is gnome/nautilus mounting and unmounting without root
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Linux Mint, Ubuntu Netbook Edition, et al
Posts: 108
Rep:
How is gnome/nautilus mounting and unmounting without root
Hello,
Gnome version 2.28.1 with kernel 2.6.31-14 on an Ubuntu 9.10 Karmic box.
I'm wondering how usb drives, etc get automounted in gnome now days. Thought it might be fusermount, but no. Gnome-mount is not installed. Perhaps it is via HAL or udev, but what commands control it? I've found posts that talk about using gnome-mount, but these are outdated as this package isn't even installed by default anymore.
I would like to unmount certain volumes via the command line, but without having root privileges as gnome is doing by clicking in nautilus. I would like to do the equivalent from the command line.
Are there any command lines commands that will allow me to do this (not talking about pmount which is not installed)?
Also, is there a way to prevent automounting of just certain devices, but not all? I have a USB with 7 different things on it (a "built-in" CD for some reason for windoz users, the original NTFS, and 5 linux partitions). I really only want one of the linux partitions (an XFS for DVD isos) to automount but not all the others. I would like not to have to disable ALL automounting as in:
So, for the most current Gnome'rs out there, this is how it is done and how scripting can manage it. BTW, somehow, fuser is involves as can be seen with:
Code:
woodnt@toshiba-laptop /dev $ mount|grep fuse
none on /sys/fs/fuse/connections type fusectl (rw)
gvfs-fuse-daemon on /home/woodnt/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=woodnt)
Now, how does one modify udev rules or hal policies to prevent mounting of all partitions except the one you want. Feel free to chime in, or I'll post if I find the answer for future posterity.
However, I don't want to have to "assign" a mountpoint like /media/data to it.
gvfs-mount automatically creates a mountpoint, then mounts the partition to that sight. It cleans up after itself well, too. It will unmount the partition and delete the mountpoint. Otherwise, for all my drives and partitions, I have to leave mountpoints with the volume names like /media/DATA, /media/Linux1, /media/Linux2, etc for each volume label of each partition of all the USB hard drives I have (quite a fiew). That seems like a waste.
Hence, my desire to go a step (or two) deeper than just a "simple" /etc/fstab entry that commits me to have a mountpoint directory already made and static, rather than dynamic.
That, plus I just want to learn (udev rulz or HAL rulz, or whatever).
This is all very well for writing a rule to match a device that wasn't automatically detected, or for simple changes such as renaming a device.
However, the real complexity of udev, I think, is the number of pre-defined rules files, found in /lib/udev/rules.d/
e.g. for a hard drive, maybe 95-devkit-disks.rules is matched.
You can't edit these files directly.
Supposedly you can write a rule file in /etc/udev/rules.d/ with a higher number than one in /lib/udev/rules.d/ and it will run first, or just copy the relevant file to /etc/udev/rules.d/ and it will suppress the running of the copied file.
However, I did not find this to be the case, when trying to fix an error in 75-persistent-net-generator.rules relating to USB-ethernet adaptors.
Also, it can be difficult to understand what they are doing due to insufficient commenting.
Can anyone point to documentation on the built-in rules?
This is all very well for writing a rule to match a device that wasn't automatically detected, or for simple changes such as renaming a device.
However, the real complexity of udev, I think, is the number of pre-defined rules files, found in /lib/udev/rules.d/
e.g. for a hard drive, maybe 95-devkit-disks.rules is matched.
You can't edit these files directly.
Supposedly you can write a rule file in /etc/udev/rules.d/ with a higher number than one in /lib/udev/rules.d/ and it will run first, or just copy the relevant file to /etc/udev/rules.d/ and it will suppress the running of the copied file.
However, I did not find this to be the case, when trying to fix an error in 75-persistent-net-generator.rules relating to USB-ethernet adaptors.
Also, it can be difficult to understand what they are doing due to insufficient commenting.
Can anyone point to documentation on the built-in rules?
Thanks, I'll be eager to check out the site you suggest.
I think it the answer may be found in HAL rules, rather than udev.
I found this last night, but it was getting late to test it and I have been too busy today.
If anyone tries it and it works, post back here. I'll do the same.
Distribution: Linux Mint, Ubuntu Netbook Edition, et al
Posts: 108
Original Poster
Rep:
The only little snag here is that one must be careful to give partition names that are unique if you want to be specific, per partition, because it is based on the partition (aka volume) label.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.