PC will not start when NAS disconnected

Just upgraded to 42.1 and as usual first job was to connect to NAS.
Dead easy, using YAST > NFS client, all is working fine…
or it was until I tried to start PC with NAS not working (power to NAS disconnected).

Suse started booting and never finished, just kept trying to start…
I am guessing it was looking for NAS to mount it at boot?
I am guessing I could do something better? with NFS options? to prevent this happening.
For example when I run another OS it starts fine (even when NAS is not working) and tells me it couldn’t connect to NAS.

For now everything is back to normal (with NAS powered and working fine), but this thing puzzles me?

Am Mon, 08 Aug 2016 15:36:01 GMT
schrieb bambuko <bambuko@no-mx.forums.microfocus.com>:

> Just upgraded to 42.1 and as usual first job was to connect to NAS.
> Dead easy, using YAST > NFS client, all is working fine…
> or it was until I tried to start PC with NAS not working (power to NAS
> disconnected).
>
> Suse started booting and never finished, just kept trying to start…
> I am guessing it was looking for NAS to mount it at boot?
> I am guessing I could do something better? with NFS options? to prevent
> this happening.
> For example when I run another OS it starts fine (even when NAS is not
> working) and tells me it couldn’t connect to NAS.
>
> For now everything is back to normal (with NAS powered and working
> fine), but this thing puzzles me?
>
>

https://wiki.manjaro.org/index.php?title=Fstab_-_Use_SystemD_automount

AK


Never attribute to malice that which can be adequately explained by stupidity.
(R.J. Hanlon)

Add nofail to mount parameters in /etc/fstab

My personal experience for the last few years is, that NFS v3 mounts via fstab are unreliable.
Even on desktop systems, I prefer to set up the automounter for exactly the reasons outlined by this thread’s originator.

  • IMHO, for laptop machines, the use of the automounter is possibly the only sensible way to use NFS to access network disk space.

[HR][/HR]Given KDE as a GUI and, regardless of KDE4 Plasma or KDE Plasma 5, I am an unashamed admirer of Dolphin’s capabilities with respect to accessing remote disk space from the Desktop Environment, regardless of the underlying network protocol being used to achieve the access.

I’m inclined to agree with this line of reasoning :slight_smile:

Thank you guys!

So far I had no reliability issues with my NFS mount but I bow to your (vastly greater) experience.

Is there somewhere a guide how to do it? or are you suggesting that I follow this advice?:

One of the reasons I liked NFS on Suse was it’s simplicity - it takes seconds to set up…

Am Tue, 09 Aug 2016 09:46:02 GMT
schrieb bambuko <bambuko@no-mx.forums.microfocus.com>:

>
> Akoellh;2788293 Wrote:
> > …'https://wiki.manjaro.org/index.php?title=Fstab_-_Use_SystemD_automount
> > ’ (http://tinyurl.com/pwvusg8)
>
> One of the reasons I liked NFS on Suse was it’s simplicity - it takes
> seconds to set up…
>
>

So?

Only because I linked an article from another distro’s wiki does not mean
I want you to change distros but maybe this article contains something related
to your problem worth reading for any distro as it is a generic solution.

AK


Never attribute to malice that which can be adequately explained by stupidity.
(R.J. Hanlon)

Like Akoellh, I would suggest to look into the automount feature of systemd. It is of course rather new (and I did not use it until now, but want to test it), but it looks as being more easy to set up then the traditional automounter (just one or two parameters in the fstab entry).

And of course it is all in the man pages describing the several systemd tools/configurations right on your openSUSE system:
[CODEman systemd.automount]



---

I have the same sort of problem. System A NFS exports a directory. System B mounts it. Sometimes system B boots when system A is not available. My solution thus far is:


  - put noauto in the fstab entry on system B (the nofail can be added if wanted, but until now I did not realy need it); 
  - have a crontab entry for root running every minute:

-*/1 * * * * /root/bin/nfsmount

 
  - and then of course having the script nfsmount

#!/bin/bash
if -a /home/wij/Niet-gemount ]]
then ping -c 1 -q boven >/dev/null && mount /home/wij >/dev/null 2>&1
fi

 


The test assumes tha there is a file Niet-gemount in the mount point /home/wij/ directory. **This file is put there while there is no mount active at the mount point. **Thus, when the mount is active, this file is hidden beneath it.
You can of course use any other test that checks if the mount is active, like checking the output of the mount command.

I was thinking of replacing this with automounter usage, but until now I was to lazy. But the new systemd automounter feature is inviting to try it.:)

I appreciate all replies and now that you have elaborated beyond just giving me a link I understand you better - thank you.

Thank you for detailed explanation!
I will do some reading now and try to implement.

There’s the openSUSE Documentation: “On-Demand Mounting with Autofs” <https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.autofs.html&gt;
This documentation is located in the Reference manual: <https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/index.html&gt;
Which is available from here: <https://doc.opensuse.org/&gt;
Detailed information in addition to what’s in the handbook is available from the automount man pages:


 > apropos automount
auto.master (5)      - Master Map for automounter
autofs (5)           - Format of the automounter maps
autofs (8)           - Control Script for automounter
automount (8)        - manage autofs mount points
rcautofs (8)         - Control Script for automounter
systemd.automount (5) - Automount unit configuration
 > 

[HR][/HR]Some examples from this 13.2 Desktop system – I think that my Leap 42.1 laptop is not different, but I’ll check it later:


   > cat /etc/fstab
/dev/disk/by-id/ata-OCZ-VERTEX2_OCZ-HC8068405854W13J-part2      swap    swap    defaults 0 0
/dev/disk/by-id/ata-OCZ-VERTEX2_OCZ-HC8068405854W13J-part1      /       ext4    defaults,noatime,acl,user_xattr 1 1
/dev/disk/by-id/ata-ST3500418AS_Z2AENPNG-part3  /home   xfs     defaults,noquota 1 2
/dev/disk/by-id/ata-WDC_WD10EZEX-60M2NA0_WD-WCC3F5AYCJL7-part2  /home01 xfs     defaults,noquota 1 2
/dev/disk/by-id/ata-ST3500418AS_Z2AENPNG-part2  /srv    ext4    defaults,noatime,acl,user_xattr 1 2
/dev/disk/by-id/ata-ST3500418AS_Z2AENPNG-part1  /tmp    ext4    defaults,noatime,acl,user_xattr 1 2
/dev/disk/by-id/ata-WDC_WD10EZEX-60M2NA0_WD-WCC3F5AYCJL7-part1  /var    ext4    defaults,noatime,acl,user_xattr 1 2
 > 
 > cat /etc/auto.master
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc  /etc/auto.misc
/mnt/MyBookWorld file:/etc/auto.MyBookWorld --timeout=120
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
#/net   -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
#+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
# +auto.master
 > 
 > cat /etc/auto.MyBookWorld
.directory -soft,retrans=0,retry=0,ro,noatime MyBookWorld.fritz.box:/DataVolume/.directory
Download -noatime MyBookWorld.fritz.box:/DataVolume/Download
Public -noatime MyBookWorld.fritz.box:/DataVolume/Public
xxx -noatime MyBookWorld.fritz.box:/DataVolume/xxx
yyy -noatime MyBookWorld.fritz.box:/DataVolume/yyy
zzz -noatime MyBookWorld.fritz.box:/DataVolume/zzz
www_srv -noatime MyBookWorld.fritz.box:/DataVolume/www_srv
 > 

I’ve mostly left the default settings in the /etc/autofs.conf unchanged – for example:

  • “master_map_name” is the default: ‘auto.master’
  • “mount_nfs_default_protocol” is the default: ‘3’

In the amd ] section, “dismount_interval” is set to ‘300’ and “autofs_use_lofs” is set to ‘yes’.
[HR][/HR]That’s it!!!

Thank you very much indeed! :slight_smile: