How to specify automount options without /etc/fstab

Todd And Margo Chester toddandmargo at gmail.com
Mon Aug 27 00:15:32 CEST 2012


On 08/26/2012 01:59 PM, dg1727 wrote:
> Hello,
>
> I have posted this same question on the Xfce forum just now:
>
> A user of mine has Xfce 4.8.3 (I believe - it's the default version
> that came with the distro) on Xubuntu 12.04.1
>
> I would like to set up his computer so that when any volume is
> about to be automounted, if the volume is ext4, then the volume is
> mounted with certain options specified by me.  Any other
> automounted volumes can be automounted according to the system
> defaults.
>
> I _don't_ want to use the conventional way of specifying volume
> label, block-device name, and/or mount point in the /etc/fstab
> file.  The volume in question will be connected by USB, and any of
> those 3 attributes of it may change.
>
> Would I have to replace "thunar-volman" with something else in
> order to modify the automounting process as I'm proposing?  Or is
> there a way to have a script intercept automounts before they get
> to "thunar-volman", whilst letting thunar-volman handle all
> automounts that my script doesn't handle?
>
> Thank you for any help.
>
> -dg1727
>

Hi DG,

I have a script I use to mount my five USB sticks the way I want.
I do this by searching for their label after they are plugged
in and before they are mounted.  It is based on the command:

     $ ls -al /dev/disk/by-label
     ...
     lrwxrwxrwx. 1 root root  10 Aug 26 11:50 lin-bak -> ../../dm-2
     lrwxrwxrwx. 1 root root  10 Aug 26 15:05 MyCDs -> ../../sdd1
     lrwxrwxrwx. 1 root root  10 Aug 26 15:05 RN -> ../../sdf1
     lrwxrwxrwx. 1 root root  10 Aug 26 15:05 ShinyStick -> ../../sdc1
     lrwxrwxrwx. 1 root root  10 Aug 26 15:05 TRIPSTICK -> ../../sde1

I have a subroutine, which refines the above:

FindDevice () {
    # incomming variables
    Label=$1

    Device="`readlink -e /dev/disk/by-label/$Label`"
    if [ "$?" != "0" ]; then Device="none"; fi

    echo $Device
    return
}

The above lets me know the stick's device assignment.  That
way I can mount them the way I like.

If you are handy at scripts, you could modify my script to your
liking.  Let me know and I will post it back to here.

-T


More information about the Xfce mailing list