[opensuse] Automounting after bringing network up
Hello, I have a Leap 42.2 station and need to have a network share mounted. I tried to add a curlftpfs line to /etc/fstab, only to get emergency mode instead of GUI. After removing plymouthd that was not really at fault (but for some reason sent SIGRTMIN+21 and sometimes dumped core, so I thought it was at fault), I realized that the problem was the mount. The network is not up at the time /etc/fstab is processed. Is it possible to have an automatic mount that runs when the network is already up, but before the login screen? -- Yours, Mikhail Ramendik Unless explicitly stated, all opinions in my mail are my own and do not reflect the views of any organization -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Mikhail Ramendik <mr@ramendik.ru> writes:
Is it possible to have an automatic mount that runs when the network is already up, but before the login screen?
Do you really need it before the login screen? Quick and dirty. Set it to noauto in fstab and put the mount command in /etc/rc.d/after.local Charles -- I did this 'cause Linux gives me a woody. It doesn't generate revenue. (Dave '-ddt->` Taylor, announcing DOOM for Linux)
On 2017-06-16 02:48, Mikhail Ramendik wrote:
Hello,
I have a Leap 42.2 station and need to have a network share mounted. I tried to add a curlftpfs line to /etc/fstab, only to get emergency mode instead of GUI. After removing plymouthd that was not really at fault (but for some reason sent SIGRTMIN+21 and sometimes dumped core, so I thought it was at fault), I realized that the problem was the mount. The network is not up at the time /etc/fstab is processed.
Is it possible to have an automatic mount that runs when the network is already up, but before the login screen?
_netdev The traditional trick was to use option _netdev in the fstab line. But I'm not sure systemd respects it. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
Am Freitag, 16. Juni 2017, 01:48:29 CEST schrieb Mikhail Ramendik:
I have a Leap 42.2 station and need to have a network share mounted. I tried to add a curlftpfs line to /etc/fstab, only to get emergency mode instead of GUI. After removing plymouthd that was not really at fault (but for some reason sent SIGRTMIN+21 and sometimes dumped core, so I thought it was at fault), I realized that the problem was the mount. The network is not up at the time /etc/fstab is processed.
systemd automatically detects that a mount needs a network. But "curlftps" is not on its list. So, Carlos tip "use option _netdev" is correct: http://codingberg.com/linux/systemd_when_to_use_netdev_mount_option However, if the network share is not available, this might fail. So, you should add "nofail", too.
[...] Is it possible to have an automatic mount that runs when the network is already up, but before the login screen?
Since you already started editing fstab, you could try systemd automount by adding(!) the following options: noauto,x-systemd.automount,x-systemd.idle-timeout=60,nofail Then, systemd will mount your share only when needed and will automatically unmount it if you don't use it anymore. That is pretty cool for laptops being used in different locations where different shares are available. Personally, I use the old autofs/automount because it supports wildcard automounting: https://doc.opensuse.org/documentation/leap/reference/html/ book.opensuse.reference/cha.autofs.html#sec.autofs.advanced.wildcards Gruß Jan -- Enough research will tend to support your theory. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Fri, Jun 16, 2017 at 11:17 AM, Jan Ritzerfeld <suse@mailinglists.jan.ritzerfeld.org> wrote:
Since you already started editing fstab, you could try systemd automount by adding(!) the following options: noauto,x-systemd.automount,x-systemd.idle-timeout=60,nofail Then, systemd will mount your share only when needed and will automatically unmount it if you don't use it anymore. That is pretty cool for laptops being used in different locations where different shares are available.
Interesting. In what openSUSE release did this become available? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am Freitag, 16. Juni 2017, 12:01:32 CEST schrieb Roger Oberholtzer:
On Fri, Jun 16, 2017 at 11:17 AM, Jan Ritzerfeld
<suse@mailinglists.jan.ritzerfeld.org> wrote:
[x-systemd.automount] Interesting. In what openSUSE release did this become available?
Looks like in the 12.1 release from 2011: https://news.opensuse.org/2011/12/22/systemd-%E2%80%93-boot-faster-and-clean... Gruß Jan -- Character is what you know you are, not what others think you are. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Roger Oberholtzer wrote:
On Fri, Jun 16, 2017 at 11:17 AM, Jan Ritzerfeld <suse@mailinglists.jan.ritzerfeld.org> wrote:
Since you already started editing fstab, you could try systemd automount by adding(!) the following options: noauto,x-systemd.automount,x-systemd.idle-timeout=60,nofail Then, systemd will mount your share only when needed and will automatically unmount it if you don't use it anymore. That is pretty cool for laptops being used in different locations where different shares are available.
Interesting. In what openSUSE release did this become available?
The old automount has been around for a long time, the systemd variety is newish. -- Per Jessen, Zürich (23.8°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-06-16 11:17, Jan Ritzerfeld wrote:
Since you already started editing fstab, you could try systemd automount by adding(!) the following options: noauto,x-systemd.automount,x-systemd.idle-timeout=60,nofail Then, systemd will mount your share only when needed and will automatically unmount it if you don't use it anymore. That is pretty cool for laptops being used in different locations where different shares are available.
Wow. This is interesting. man mount: x-* All options prefixed with "x-" are inter- preted as comments or as userspace applica- tion-specific options. These options are not stored in the mtab file, nor sent to the mount.type helpers nor to the mount(2) system call. The suggested format is x- appname.option (e.g. x-systemd.automount). So, where are these documented? -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
Am Freitag, 16. Juni 2017, 13:15:54 CEST schrieb Carlos E. R.:
[...] So, where are these documented?
Ah, sorry, I forgot to mention man systemd.mount and man systemd.automount Gruß Jan -- If she's Snow White, then I must be Grumpy. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (6)
-
Carlos E. R.
-
Charles Philip Chan
-
Jan Ritzerfeld
-
Mikhail Ramendik
-
Per Jessen
-
Roger Oberholtzer