Re Ubuntu autofs rule hides my home directory so I cannot login (TomH)

Frank Chang frankchang91 at gmail.com
Mon May 30 14:41:40 UTC 2016


Hi Tom H.,

    Thank you for your excellent answer just now. Our architect  and I
would like to solve the following problem. May I ask if you could look into
this problem briefly?

I spent 6 hours yesterday testing @Ingo Blackman's answer to the Unix and
Linux Stack Exchange article,

[Automounting USB sticks on Debian
<http://unix.stackexchange.com/questions/24731/automounting-usb-sticks-on-debian]>

When I use a udev rule ACTION=="add" and RUN+="/bin/ln -sf
/media/autousb/%k /media/frank/usb/%k" , shown immediately below:

# Add symlink /dev/usbdisks/<label> to /dev/sd[a-z][1-9]
# for automounter support

ACTION=="add", KERNEL=="sd*", ENV{DEVTYPE}=="partition", \
    ENV{ID_BUS}=="usb", \
    SYMLINK+="usbdisks/%k", MODE:="0660", \
    RUN+="/bin/rm /media/usb/%k", \
    RUN+="/bin/ln -sf /media/autousb/%k /media/frank/usb/%k"

# Some FileSystems emit a "change" event when they are unmounted.
# UDEV seems to delete the device symlink in this case :-(
# So we need to re-create it here
ACTION=="change", KERNEL=="sd*", ENV{DEVTYPE}=="partition", \
    ENV{ID_BUS}=="usb", \
    SYMLINK+="usbdisks/%k", MODE:="0660"


# When device is removed, also remove /media/usb/<...>
ACTION=="remove", KERNEL=="sd*", ENV{DEVTYPE}=="partition", \
    ENV{ID_BUS}=="usb", \
    RUN+="/bin/rm /media/frank/usb/%k"

the udev or autofs service creates the directory /media/autousb with 755
permission rather than 777 permission so that udev or autofs cannot create
regular files or soft links inside /media/autousb.

May I ask how to fix this?

My simplistic hypothesis is that since I am Ubuntu 16.04 user frank
belonging to the group plugdev along with user root, the above udev add
rule should work if I change use /media/autousb to /media/frank/autousb.

Thank you.

On Mon, May 30, 2016 at 8:00 AM, <ubuntu-users-request at lists.ubuntu.com>
wrote:

> Send ubuntu-users mailing list submissions to
>         ubuntu-users at lists.ubuntu.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> or, via email, send a message with subject or body 'help' to
>         ubuntu-users-request at lists.ubuntu.com
>
> You can reach the person managing the list at
>         ubuntu-users-owner at lists.ubuntu.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ubuntu-users digest..."
>
>
> Today's Topics:
>
>    1. Re: Ubuntu autofs rule hides my home directory so I cannot
>       login (Tom H)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 30 May 2016 12:11:03 +0200
> From: Tom H <tomh0665 at gmail.com>
> To: Ubuntu Users <ubuntu-users at lists.ubuntu.com>
> Subject: Re: Ubuntu autofs rule hides my home directory so I cannot
>         login
> Message-ID:
>         <CAOdo=SzTLegNfHbd31vJp+C41P=
> WUFMm5OfdBq1z_sf+aKpWgQ at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Thu, May 26, 2016 at 9:02 PM, Frank Chang <frankchang91 at gmail.com>
> wrote:
> >
> > I perused the answers in this excellent Unix Stack Exchange article;
> > http://unix.stackexchange.com/questions/24731/automounting-usb-sticks-
> > on-debian and tested it earlier yesterday on an Ubuntu Linux 16.04
> > instance, Lenovo Thinkstation quad core desktop, and saw that the
> > autofs rule hides my /home/frank directory and /media/data1 directory.
> >
> > Why does this autofs hint hide my /home/frank subdirectory so I cannot
> > reboot and login again?
> >
> > How do I fix the autofs procedure, which is an alternative to modifying
> > /etc/fstab
>
> AFAIR, the default Ubuntu autofs setup doesn't touch "/home".
>
> Is your USB disk being mounted on "/media/data1" by autofs?
>
> You can check the maps that are configured with "automount -m".
>
>
> > Finally, why is the autofs hint preferred by Ubuntu Linux practioners
> > over modifying /etc/fstab for the purpose of creating a permanent mount
> > point for a CD, DVD or USB drive.
>
> It isn't. This is a convoluted way to override/avoid the standard way
> that DEs mount USB disks, on "/run/<uid>/<label_or_filesystem-uuid>"
> via IIRC udisks.
>
>
>
> ------------------------------
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
> End of ubuntu-users Digest, Vol 141, Issue 60
> *********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20160530/3e2b81a8/attachment.html>


More information about the ubuntu-users mailing list