Automount Volumes

View: New views
2 Messages — Rating Filter:   Alert me  

Automount Volumes

by Flashrider :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

just in case there's anyone out there who's using Sawfish standalone
but does not have automount support for removable storages, here a
pretty simple way:

install the pmount package (most distros already ship it, else
check http://pmount.alioth.debian.org/ )

create a file called /etc/udev/rules.d/automount.rules

with the rules for removable storages, here's my file, which should fit
the most of you, syntax should be clear, so modify it to your needs (if
it's not, just ask):

KERNEL=="sd*", ACTION=="add", RUN+="/usr/bin/pmount --sync --umask 000 %k"
KERNEL=="sd*", ACTION=="remove", RUN+="/usr/bin/pumount %k"

Now let the changes immediately take effect:

udevadm control --reload_rules

Depending on the device it may take up to ~10 seconds before it's
mounted and also depending on the device up to another ~10 seconds
before you can access it via a file-manager, but most devices should be
accessible faster.

This way you don't need a plugdev group or to make pmount setuid-root
or something like that.

Mount points are /media/[node] (/dev/sdc2 is mounted to /media/sdc2)

Regards,
Chris

Re: Automount Volumes

by Flashrider :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Sun, 1 Nov 2009 17:13:28 +0100
schrieb Christopher Roy Bratusek <zanghar@...>:

> Hi all,
>
> just in case there's anyone out there who's using Sawfish standalone
> but does not have automount support for removable storages, here a
> pretty simple way:
>
> install the pmount package (most distros already ship it, else
> check http://pmount.alioth.debian.org/ )
>
> create a file called /etc/udev/rules.d/automount.rules
>
> with the rules for removable storages, here's my file, which should
> fit the most of you, syntax should be clear, so modify it to your
> needs (if it's not, just ask):
>
> KERNEL=="sd*", ACTION=="add", RUN+="/usr/bin/pmount --sync --umask
> 000 %k" KERNEL=="sd*", ACTION=="remove", RUN+="/usr/bin/pumount %k"
>
> Now let the changes immediately take effect:
>
> udevadm control --reload_rules
>
> Depending on the device it may take up to ~10 seconds before it's
> mounted and also depending on the device up to another ~10 seconds
> before you can access it via a file-manager, but most devices should
> be accessible faster.
>
> This way you don't need a plugdev group or to make pmount setuid-root
> or something like that.
>
> Mount points are /media/[node] (/dev/sdc2 is mounted to /media/sdc2)
>
> Regards,
> Chris

Of course that must be modified if running on a non-UDEV OS