Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: automount settings

  1. #1
    Join Date
    May 2017
    Location
    Russia
    Posts
    137

    Default automount settings

    Hello, Usually, when I install new OpenSUSE and make automount of any disk at the pre-installation settings (1), within /mnt dir, all is good (f.e., I have 2 disks and second I mount in /mnt/disc2 at pre-install partition settings).
    But when I don't, my automount doesn't work even with USB flash drives. (2)
    Autofs is installed. All (1) and (2) are same with a clean installation without package changing (Last time I tried it on Leap 15.1 2 times when I changed my SSD).
    When I try to mount USB manually, it has only READ permissions (but one time I did it with some trick I forgot now.
    And it is not
    Code:
    sudo mount -o remount,rw /partition/identifier /mount/point 
    but something maybe like
    Code:
    /dev/sda1 /mnt/usbstick vfat user,noauto,noatime,flush 0 0
    I don't remember and I can't repeat it now.
    Anyway, I think there is a trick of (1) step. Maybe /mnt became special and have other permissions. So, I tried
    Code:
    sudo chown psijic /mnt
    sudo chmod 755 /mnt
    it helps none.

    What is the trick to configure automount properly like it makes step (1)?

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,579
    Blog Entries
    1

    Default Re: automount settings

    Most users would just use the udisks/udev/DE mounting mechanism to detect and auto-mount USB media, but I assume you specifically prefer (or require) traditional root-controlled mounting via a static entry in /etc/fstab?
    openSUSE Leap 15.1; KDE Plasma 5

  3. #3
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,579
    Blog Entries
    1

    Default Re: automount settings

    If you specifically want to use Autofs for "on-demand" mounting, you should read the following reference:
    https://doc.opensuse.org/documentati...ha.autofs.html

    That requires appropriate configuration of /etc/auto.master (with a reference to auto.foo) and /etc/auto.foo with an appropriate entry as well.

    However, for single-user access to USB media the udisks/udev mechanism is preferable IMHO. (Even for installations not using a desktop environment, mount helpers such as udiskie can provide a simple solution for automatic mounting of USB media.)

    https://wiki.archlinux.org/index.php/Udisks
    openSUSE Leap 15.1; KDE Plasma 5

  4. #4
    Join Date
    Feb 2016
    Location
    Berlin
    Posts
    357

    Default Re: automount settings

    for info i found systemd.automount absurdly simply to implement (compared to using autofs directly)

  5. #5
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,579
    Blog Entries
    1

    Default Re: automount settings

    Quote Originally Posted by ndc33 View Post
    for info i found systemd.automount absurdly simply to implement (compared to using autofs directly)
    Yes, that's a good option for "system-level" automounting as well.
    openSUSE Leap 15.1; KDE Plasma 5

  6. #6
    Join Date
    May 2017
    Location
    Russia
    Posts
    137

    Default Re: automount settings

    Thanks. Actually, I have no preferences except it should be an optimal way. And I think, automount should be available for different users because it's the right way of a common PC usage.
    Now I see, even Krusader's MountMan can't see USB devices (but SUSE ImageWriter can).

  7. #7
    Join Date
    May 2017
    Location
    Russia
    Posts
    137

    Default Re: automount settings

    Quote Originally Posted by deano_ferrari View Post
    Yes, that's a good option for "system-level" automounting as well.
    do you mean something like that?
    Code:
    sudo systemctl SUB_COMMAND autofs
    where SUB_COMMAND is one of:
    enable - Starts the automounter daemon at boot.

  8. #8
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,579
    Blog Entries
    1

    Default Re: automount settings

    Quote Originally Posted by psijic View Post
    do you mean something like that?
    Code:
    sudo systemctl SUB_COMMAND autofs
    No, systemd.automount....

    https://www.freedesktop.org/software...automount.html

    where automount units may either be configured via unit files, or via entries in the /etc/fstab config file

    For more info read the manpage...
    Code:
    man systemd.automount
    openSUSE Leap 15.1; KDE Plasma 5

  9. #9
    Join Date
    May 2017
    Location
    Russia
    Posts
    137

    Default Re: automount settings

    Quote Originally Posted by deano_ferrari View Post
    No, systemd.automount....

    https://www.freedesktop.org/software...automount.html

    where automount units may either be configured via unit files, or via entries in the /etc/fstab config file

    For more info read the manpage...
    Code:
    man systemd.automount
    So, for USB flash automounting I need to make a file like that?
    Code:
    /etc/systemd/system/mnt-usb.automount:
    [Unit]
    Description=USB Flash Drive
    What=???
    Requires=???
    [Automount]
    Where=/mnt/usb
    TimeoutIdleSec=301
    Type=???
    Options=rw DirectoryMode=0755
    What I need to add? Or it will be 2 files - mount and automount?
    And after that I need to run
    Code:
    sudo systemctl daemon-reload
    Is it all?

  10. #10
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,579
    Blog Entries
    1

    Default Re: automount settings

    Quote Originally Posted by psijic View Post
    So, for USB flash auto-mounting I need to make a file like that?
    Actually, all you need to do is add a suitable entry in /etc/fstab, and systemd will take care of the "on demand" mounting (creating a systemd unit dynamically at boot).

    From 'man systemd.mount'...

    FSTAB

    Mount units may either be configured via unit files, or via /etc/fstab (see fstab(5) for details). Mounts listed in /etc/fstab will be converted into native units dynamically at boot and when the configuration of the system manager is reloaded. In general, configuring mount points through /etc/fstab is the preferred approach. See systemd-fstab-generator(8) for details about the conversion.
    For example
    Code:
    /dev/sdb1   /mnt/usb     auto     noauto,x-systemd.automount     0 2
    However, a unit file can be created manually if desired.
    Last edited by deano_ferrari; 25-Jun-2019 at 01:44.
    openSUSE Leap 15.1; KDE Plasma 5

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •