Autofs hängt sich auf, nachdem Mountpoint nicht mehr verfügbar ist

Begonnen von Bartimaus, 20 Dezember 2021, 18:00:52

Vorheriges Thema - Nächstes Thema

Bartimaus

Hallo Zusammen,

ich hoffe ich bin hier richtig mit meiner Frage.

Ich habe mehrere LinuxServer (Qnap,Raspi4,BananaPi) in Betrieb.

Für einen übergreifenden Zugriff habe ich AutoFS installiert und konfiguriert.

2 der Server laufen 24/7 (FHEM-Server+ PiHoleServer).
BananaPi und QNAP laufen nur temporär.

Starte ich den BananaPi, wird er vom PiHole-Server per Autofs automatisch via NFS gemontet und ich kann auf die freigegebenen Verzeichnisse des BPi zugreifen.
Wird der BPI jedoch heruntergefahren, hängt sich AutoFS am PiHole dermassen auf, so das nu ein Neustart des PiHole hilft.

Starten/mounten + herunterfahren/Unmounten z.B. des QNAPs bereitet dem PiHole keine Probleme.

Die Mounts sind identisch mit den gleichen Optionen konfiguriert.

Hat jemand ne Idee was hier schiefläuft, bzw. wo ich nach dem Fehler suchen muss ?

Hier ein Auszug der messages.log auf dem PiHole

Dec 20 16:17:48 RPI4-DNS-UNIFI kernel: [21288.320352] nfs: server 192.168.xxx.5 not responding, timed out
Dec 20 16:17:56 RPI4-DNS-UNIFI kernel: [21295.360407] nfs: server 192.168.xxx.5 not responding, timed out
Dec 20 16:18:04 RPI4-DNS-UNIFI kernel: [21304.320507] nfs: server 192.168.xxx.5 not responding, timed out


hier die Map-Datei auf dem PiHole-Server


QnapBackup -fstype=nfs,rw,retry=0 192.168.XXX.6:/share/Backup/
Rpi4FHEM -fstype=nfs,rw,retry=0 192.168.xxx.7:/media/
BPiMedia -fstype=nfs,retry=0 192.168.241.5:/media/

LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Mir fallen da ein paar Fragen ein ...
- Weißt Du, mit welcher Version von NFS Du mountest?
- Wohin mountest Du? Also der Mountpoint
- Hat auf dem Mountpoint eine Software dauerhaft Zugriff?
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

Hallo Werniemann,

danke für Deine Rückmeldung... hatte mir schon gedacht das Du als LinuxProfi Dich meldest  ;D

Berechtigte Fragen,

- Versionsnummern weiss ich ad hoc nicht, aber ich halte die Systeme durch wöchentliche Updates aktuell, schaue ich aber noch nach
- Mountpoint ist auf dem jeweiligen Device immer: /mnt/"gemountetes Device" aka BPi/QNAP/RPiFHEM
- Ja, auf dem Linux wo sich das AutoFS aufhängt, greift der installierte PlexServer auf die gemounteten Geräte zu. Hatte dies auch im Verdacht, habe dann das "automatische Aktualisieren bei Plex" ausgeschaltet. Problem trat danach immer noch auf. Auf das QNAP greift der PlexServer auch zu, da trat das Problem aber nicht auf.


Als Workarount mounte ich jetzt den BPi vom Plex/DNS/PiHole/Raspi via CIFS und nicht mehr NFS, das scheint bis jetzt zu helfen.
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

#3
Die QNAP dürfte ein älteres NFS fahren als ein "normales" Linux. Kann es aktuell nicht überprüfen und Dir damit auch nicht sagen, wie man die Versionnummer, welche verwendet wird, überprüfen kann. Laut google solltest Du es finden mit:
nfsstat -c
nfsstat -m
Könntest Du mir den Output der Befehle geben? (Hinweis: Bitte als root)

Du könntest auch mit "nfsvers=3" im mont-Befehl es Konfigurieren. Auch ein Async-Betrieb mit "async" ist sinnvoll
Siehe u.A.: https://wiki.ubuntuusers.de/NFS/, https://docs.oracle.com/cd/E19253-01/816-4555/rfsrefer-18/index.html

Edit
Typo korrigiert + Ergänzungen zum mount + Doku-Links
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Bartimaus

#5
Büdde:

sudo nfsstat -c
Client rpc stats:
calls      retrans    authrefrsh
212185     0          212187

Client nfs v3:
null             getattr          setattr          lookup           access
5         0%     1550      0%     0         0%     105       0%     224       0%
readlink         read             write            create           mkdir
104       0%     197398   98%     0         0%     0         0%     0         0%
symlink          mknod            remove           rmdir            rename
0         0%     0         0%     0         0%     0         0%     0         0%
link             readdir          readdirplus      fsstat           fsinfo
0         0%     0         0%     30        0%     8         0%     62        0%
pathconf         commit
31        0%     0         0%

Client nfs v4:
null             read             write            commit           open
97        0%     7256     57%     0         0%     0         0%     0         0%
open_conf        open_noat        open_dgrd        close            setattr
0         0%     556       4%     0         0%     556       4%     0         0%
fsinfo           renew            setclntid        confirm          lock
13        0%     0         0%     0         0%     0         0%     0         0%
lockt            locku            access           getattr          lookup
0         0%     0         0%     946       7%     2527     19%     10        0%
lookup_root      remove           rename           link             symlink
4         0%     2         0%     0         0%     0         0%     0         0%
create           pathconf         statfs           readlink         readdir
0         0%     9         0%     42        0%     1         0%     28        0%
server_caps      delegreturn      getacl           setacl           fs_locations
22        0%     556       4%     0         0%     0         0%     0         0%
rel_lkowner      secinfo          fsid_present     exchange_id      create_session
0         0%     0         0%     0         0%     8         0%     4         0%
destroy_session  sequence         get_lease_time   reclaim_comp     layoutget
3         0%     19        0%     0         0%     4         0%     0         0%
getdevinfo       layoutcommit     layoutreturn     secinfo_no       test_stateid
0         0%     0         0%     0         0%     4         0%     0         0%
free_stateid     getdevicelist    bind_conn_to_ses destroy_clientid seek
0         0%     0         0%     0         0%     3         0%     0         0%
allocate         deallocate       layoutstats      clone
0         0%     0         0%     0         0%     0         0%


Die weiteren Mountoptionen teste ich morgen mal


LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Bartimaus

Hatte gestern Abend noch etwas mit den Einstellungen gespielt, aber nicht gespeichert oder AutoFS neu gestartet. However, heute morgen hing AutoFS wieder fest.

Dec 22 02:30:09 RPI4-DNS-UNIFI automount[10466]: attempting to mount entry /mnt/BPiMedia
Dec 22 02:30:09 RPI4-DNS-UNIFI kernel: [115195.332112] CIFS: Attempting to mount //192.168.xxx.5/media/1TBHDD/
Dec 22 02:30:15 RPI4-DNS-UNIFI automount[10466]: >> Unable to find suitable address.
Dec 22 02:30:15 RPI4-DNS-UNIFI automount[10466]: mount(generic): failed to mount //192.168.xxx.5/media/1TBHDD/ (type cifs) on /mnt/BPiMedia
Dec 22 02:30:15 RPI4-DNS-UNIFI automount[10466]: failed to mount /mnt/BPiMedia
Dec 22 02:30:15 RPI4-DNS-UNIFI kernel: [115201.606171] CIFS: VFS: Error connecting to socket. Aborting operation.
Dec 22 02:30:15 RPI4-DNS-UNIFI kernel: [115201.606192] CIFS: VFS: cifs_mount failed w/return code = -113
Dec 22 02:30:15 RPI4-DNS-UNIFI automount[10466]: expiring path /mnt/Qnap
Dec 22 02:30:27 RPI4-DNS-UNIFI automount[10466]: could not umount dir /mnt/QnapBackup
Dec 22 02:30:27 RPI4-DNS-UNIFI automount[10466]: couldn't complete expire of /mnt/QnapBackup
Dec 22 02:30:27 RPI4-DNS-UNIFI automount[10466]: expiring path /mnt/QnapMedianF


Habe jetzt gem. https://support.hpe.com/hpesc/public/docDisplay?docLocale=en_US&docId=emr_na-c02768231 den BrowseMode und NFSVERS=3 in der Autofs.conf aktiviert. Gleichzeitig habe ich auch Deinen Tip befolgt und "async" in den Mountoptionen hinzugefügt. Es bleibt spannend.

Ach ja, und das Logging habe ich jetzt mal auf "debug" gesetzt.
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Aktuell benutzt DU also beide Versionen. Habe mit nfs V4 noch nicht sooo viel rumgespielt, aber kannst mal mit verschiedenen Versionen rumprobieren.

SMB ist zwar auch eine Lösung, hat nur mehr Overhead als nfs, dafür natürlich auch mehr Sicherheit
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Wernieman

Du hast geantwortet, während ich geschrieben habe.

Eine Frage am Rande: Wie ist Dein Pi angebunden? WLAN oder Kabel?

CIFS scheint bei Dir Netzwerkprobleme zu haben
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

Hi, obwohl ich ja NFSVERS=3 aktiviert habe, bekomme ich via "sudo nfsstat -c" immer noch das gleiche Ergebnis wie oben.

Hm, finde nix zu dem "Returncode -113" bei CIFS. Hast Du da was gefunden ?

Habe alle Server per LAN angebunden. Allerdings bringst mich da auf etwas.... der RPi4-Pihole hängt an einer Dual-Netzwerkdose via Patchkabel. Obwohl dort lt. Netzwerktester alles ok ist, klagt mein Sohn mit seiner PS5 auch über ab und an von Aussetzern an dieser Dose........, hm..... vielleicht nochmal neu auflegen ?


LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Kannst mal gucken, welche "error"-Anzahl die Netzwerkkarte wirft (ifconfig). Sollte normalerweise um die 0 sein, wenn die Kiste nicht schon Jahre läuft.

Für die Kurzfassung (als root)
ifconfig | grep errors
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

So, komme gerade vom Dachboden wo ich das Patchpanel mit allen 6 Leitungen sauber neu aufgelegt habe. Incl. Erdung und korrekter Zugentlastung.
JETZT meldet der Tester auch ein "grün" bei "G".

Hier das gewünschte Ergebnis. Wird aber erst interessant, wenn ich das in 24 oder 48h neu gecheckt habe.

sudo ifconfig | grep errors
        RX errors 0  dropped 0  overruns 0  frame 0
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        RX errors 0  dropped 0  overruns 0  frame 0
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Das sieht ja schonmal gut aus. Die Spannung bleibt, und der BPi ist jetzt wieder per NFS gemountet.
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Also doch eher Netzwerkproblem. Womit hast Du das Kabel geprüft, weil Du "grün" schriebst?
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html


Wernieman

O.K. .. reiner "Durchgansprüfer"

Verstehe mich nicht falsch: Das ist schon mal ein Anfang und mehr, als ich habe. Aber ein "richtiger" Tester kann/sollte mehr. Trotzdem gut um solche Fehler zu finden.
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

#15
Schon ok.

Immerhin konnte ich damit sehen, das alle 8 Adern korrekt aufgelegt sind. Allerdings hätte ich der fehlenden "G"-Led vielleicht mehr Aufmerksamkeit schenken dürfen.

Ha, ein erneutes :

sudo nfsstat -c
Client rpc stats:
calls      retrans    authrefrsh
12259      0          12260

Client nfs v4:
null             read             write            commit           open
3         0%     7699     62%     0         0%     0         0%     0         0%
open_conf        open_noat        open_dgrd        close            setattr
0         0%     599       4%     0         0%     599       4%     0         0%
fsinfo           renew            setclntid        confirm          lock
11        0%     0         0%     0         0%     0         0%     0         0%
lockt            locku            access           getattr          lookup
0         0%     0         0%     946       7%     1684     13%     26        0%
lookup_root      remove           rename           link             symlink
3         0%     0         0%     0         0%     0         0%     0         0%
create           pathconf         statfs           readlink         readdir
0         0%     8         0%     0         0%     1         0%     22        0%
server_caps      delegreturn      getacl           setacl           fs_locations
19        0%     599       4%     0         0%     0         0%     0         0%
rel_lkowner      secinfo          fsid_present     exchange_id      create_session
0         0%     0         0%     0         0%     7         0%     5         0%
destroy_session  sequence         get_lease_time   reclaim_comp     layoutget
4         0%     14        0%     1         0%     4         0%     0         0%
getdevinfo       layoutcommit     layoutreturn     secinfo_no       test_stateid
0         0%     0         0%     0         0%     3         0%     0         0%
free_stateid     getdevicelist    bind_conn_to_ses destroy_clientid seek
0         0%     0         0%     0         0%     3         0%     0         0%
allocate         deallocate       layoutstats      clone
0         0%     0         0%     0         0%     0         0%


obwohl laut /etc/autofs.conf

#
# Define default options for autofs.
#
[ autofs ]
#
# master_map_name - default map name for the master map.
#
master_map_name = /etc/auto.master
#
# timeout - set the default mount timeout in secons. The internal
#           program default is 10 minutes, but the default installed
#           configuration overrides this and sets the timeout to 5
#           minutes to be consistent with earlier autofs releases.
#
timeout = 300
#
# negative_timeout - set the default negative timeout for
#                    failed mount attempts (default 60).
#
negative_timeout = 15
#
# mount_wait - time to wait for a response from mount(8).
#              Setting this timeout can cause problems when
#              mount would otherwise wait for a server that
#              is temporarily unavailable, such as when it's
#              restarting. The default setting (-1) of waiting
#              for mount(8) usually results in a wait of around
#              3 minutes.
#
#mount_wait = -1
#
# umount_wait - time to wait for a response from umount(8).
#
#umount_wait = 12
#
# browse_mode - maps are browsable by default.
#
browse_mode = yes
#
# mount_nfs_default_protocol - specify the default protocol used by
#                              mount.nfs(8). Since we can't identify
#                              the default automatically we need to
#                              set it in our configuration.
#
mount_nfs_default_protocol = 3


Muss ich jetzt nicht verstehen...

Jetzt lese ich mich mal in "iperf" ein...


Edith: Ergebnis iperf: zwischen allen Rpi4/Bpi Bandbreite zwischen 520-780Mbit. Also ok. QNAP meldet sogar 820Mbit Download. Hat ja auch die potentere CPU (Intel N3150)
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Was Du mir damit sagen willst, verstehe ich (aktuell) nicht ...
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

Obwohl ich (m.W) in der Konfig eingestellt habe, "bitte nur NFS Vers 3 verwenden", liefert "nfsstat -c" nur Verbindungen via NFS Vers. 4......
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Kannst Du die Config posten?

Und zwar auch die includierten!
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

#19
#
# Define default options for autofs.
#
[ autofs ]
#
# master_map_name - default map name for the master map.
#
master_map_name = /etc/auto.master
#
# timeout - set the default mount timeout in secons. The internal
#     program default is 10 minutes, but the default installed
#     configuration overrides this and sets the timeout to 5
#     minutes to be consistent with earlier autofs releases.
#
timeout = 300
#
# negative_timeout - set the default negative timeout for
#      failed mount attempts (default 60).
#
negative_timeout = 15
#
# mount_wait - time to wait for a response from mount(8).
#        Setting this timeout can cause problems when
#        mount would otherwise wait for a server that
#        is temporarily unavailable, such as when it's
#        restarting. The default setting (-1) of waiting
#        for mount(8) usually results in a wait of around
#        3 minutes.
#
#mount_wait = -1
#
# umount_wait - time to wait for a response from umount(8).
#
#umount_wait = 12
#
# browse_mode - maps are browsable by default.
#
browse_mode = yes
#
# mount_nfs_default_protocol - specify the default protocol used by
#        mount.nfs(8). Since we can't identify
#        the default automatically we need to
#        set it in our configuration.
#
mount_nfs_default_protocol = 3
#
# append_options - append to global options instead of replace.
#
#append_options = yes
#
# logging - set default log level "none", "verbose" or "debug"
#
logging = verbose
#
# force_standard_program_map_env - disable the use of the "AUTOFS_"
# prefix for standard environemt variables when
# executing a program map. Since program maps
# are run as the privileded user this opens
# automount(8) to potential user privilege
# escalation when the program map is written
# in a language that  can load components from,
# for example, a user home directory.
#
# force_standard_program_map_env = no
#
# Define base dn for map dn lookup.
#
# Define server URIs
#
# ldap_uri - space seperated list of server uris of the form
#      <proto>://<server>[/] where <proto> can be ldap
#      or ldaps. The option can be given multiple times.
#      Map entries that include a server name override
#      this option.
#
#      This configuration option can also be used to
#      request autofs lookup SRV RRs for a domain of
#      the form <proto>:///[<domain dn>]. Note that a
#      trailing "/" is not allowed when using this form.
#      If the domain dn is not specified the dns domain
#      name (if any) is used to construct the domain dn
#      for the SRV RR lookup. The server list returned
#      from an SRV RR lookup is refreshed according to
#      the minimum ttl found in the SRV RR records or
#      after one hour, whichever is less.
#
#ldap_uri = ""
#
# ldap_timeout - timeout value for the synchronous API  calls
#   (default is LDAP library default).
#
#ldap_timeout = -1
#
# ldap_network_timeout - set the network response timeout (default 8).
#
#ldap_network_timeout = 8
#
# search_base - base dn to use for searching for map search dn.
# Multiple entries can be given and they are checked
# in the order they occur here.
#
#search_base = ""
#
# Define the LDAP schema to used for lookups
#
# If no schema is set autofs will check each of the schemas
# below in the order given to try and locate an appropriate
# basdn for lookups. If you want to minimize the number of
# queries to the server set the values here.
#
#map_object_class = nisMap
#entry_object_class = nisObject
#map_attribute = nisMapName
#entry_attribute = cn
#value_attribute= nisMapEntry
#
# Other common LDAP naming
#
#map_object_class = automountMap
#entry_object_class = automount
#map_attribute = ou
#entry_attribute = cn
#value_attribute= automountInformation
#
#map_object_class = automountMap
#entry_object_class = automount
#map_attribute = automountMapName
#entry_attribute = automountKey
#value_attribute= automountInformation
#
# auth_conf_file - set the default location for the SASL
#    authentication configuration file.
#
#auth_conf_file = /etc/autofs_ldap_auth.conf
#
# map_hash_table_size - set the map cache hash table size.
# Should be a power of 2 with a ratio of
# close to 1:8 for acceptable performance
# with maps up to around 8000 entries.
# See autofs.conf(5) for more details.
#
#map_hash_table_size = 1024
#
# use_hostname_for_mounts - nfs mounts where the host name resolves
# to more than one IP address normally need
# to use the IP address to esure a mount to
# a host that isn't responding isn't done.
# If that behaviour is not wanted then set
# ths to "yes", default is "no".
#
#use_hostname_for_mounts = "no"
#
# disable_not_found_message - The original request to add this log message
# needed it to be unconditional. That produces, IMHO,
# unnecessary noise in the log so a configuration option
# has been added to provide the ability to turn it off.
# The default is "no" to maintain the current behaviour.
#
#disable_not_found_message = "no"
#
# Otions for the amd parser within autofs.
#
# amd configuration options that are aren't used, haven't been
# implemented or have different behaviour within autofs.
#
# A number of the amd configuration options are not used by autofs,
# some because they are not relevant within autofs, some because
# they are done differently in autofs and others that are not yet
# implemented.
#
# Since "mount_type" is always autofs (because there's no user space
# NFS server) the configuration entries relating to that aren't used.
# Also, server availability is done differently within autofs so the
# options that relate to the amd server monitoring sub-system are
# also not used.
#
# These options are mount_type, auto_attrcache, portmap_program,
# nfs_vers_ping, nfs_allow_any_interface, nfs_allow_insecure_port,
# nfs_proto, nfs_retransmit_counter, nfs_retransmit_counter_udp,
# nfs_retransmit_counter_tcp, nfs_retransmit_counter_toplvl,
# nfs_retry_interval, nfs_retry_interval_udp, nfs_retry_interval_tcp,
# nfs_retry_interval_toplvl and nfs_vers.
#
#
# Other options that are not used within the autofs implementation:
#
# log_file, truncate_log - autofs used either stderr when running in
# the foreground or sends its output to syslog so an alternate
# log file (or truncating the log) can't be used.
#
# print_pid - there's no corresponding option for this within autofs.
#
# use_tcpwrappers, show_statfs_entries - there's no user space NFS
# server to control access to so this option isn't relevant.
# The show_statfs_entries can't be implemented for the same
# reason.
#
# debug_mtab_file - there's no user space NFS server and autofs
# avoids using file based mtab whenever possible.
#
# sun_map_syntax - obviously, are provided by autofs itself.
#
# plock, show_statfs_entries, preferred_amq_port - not supported.
#
# ldap_cache_maxmem, ldap_cache_seconds - external ldap caching
# is not used by autofs.
#
# ldap_proto_version - autofs always attempts to use the highest
# available ldap protocol version.
#
# cache_duration, map_reload_interval, map_options - the map
# entry cache is continually updated and stale entries
# cleaned on re-load, which is done when map changes are
# detected so these configuration entries are not used
# by autofs.
#
# localhost_address - is not used within autofs. This
# configuration option was only used in the amd user
# space server code and is not relevant within autofs.
#
#
# Options that are handled differently within autofs:
#
# pid_file - must be given as a command line option on startup.
#
# print_version - program version and feature information is obtained
# by using the automount command line option "-V".
#
# debug_options, log_options - autofs has somewhat more limited
# logging and debug logging options. When the log_options
# options is encountered it is converted to the nearest
# matching autofs logging option. Since the configuration
# option debug_options would be handled the same way it
# is ignored.
#
# restart_mounts - has no sensible meaning within autofs because autofs
# always tries to re-connect to existing mounts. While this
# has its own set of problems not re-connecting to existing
# mounts always results in a non-functional automount tree if
# mounts were busy at the last shutdown (as is also the case
# with amd when using mount_type autofs).
#
# forced_unmounts - detaching mounts often causes serious problems
# for users of existing mounts. It is used by autofs in some
# cases, either at the explicit request of the user (with a
# command line or init option) and in some special cases during
# program operation but is avoided whenever possible.
#
#
# A number of configuration options are not yet implemented:
#
# fully_qualified_hosts - not yet implemented.
#
# unmount_on_exit - since autofs always tries to re-connect
# to mounts left mounted from a previous shutdown this
# is a sensible option to implement and that will be
# done.
#
# browsable_dirs - not yet implemented.
#
# exec_map_timeout - a timeout is not currently used for
# for program maps, might be implemented.
#
# tag - the tag option is not implemented within autofs.
#
#
# Supported options:
#
# arch, karch, os, osver - these options default to what is returned
# from uname(2) and can be overridden if required.
#
# full_os - has no default and must be set in the configuration
# if used in maps.
#
# cluster - if not set defaults to the host domain name. This option
# corresponds to the HP_UX cluster name (according to the amd
# source) and is probably not used in Linux but is set anyway.
#
# vendor - has a default value of "unknown", it must be set in the
# configuration if used in maps.
#
# auto_dir - is the base name of the mount tree used for external
# mounts that are sometimes needed by amd maps. Its default
# value is "/a".
#
# map_type - specifies the autofs map source, such as file, nis,
# ldap etc. and has no default value set.
#
# map_defaults - is used to override /defaults entries within maps
# and can be used to provide different defaults on specific
# machines without having to modify centrally managed maps.
# It is empty by default.
#
# search_path - colon seperated paths to search for maps that
# are not specified as a full path.
#
# dismount_interval - is equivalent to the autofs timeout option. It
# is only possible to use this with type "auto" mounts due
# to the way the autofs kernel module performs expiry. It
# takes its default value from the autofs internal default
# of 600 seconds.
#
# autofs_use_lofs - if set to "yes" autofs will attempt to use bind
# mounts for type "auto" when possible.
#
# nis_domain - allows setting of a domain name other than the system
# default.
#
# local_domain - is used to override (or set) the host domain name.
#
# normalize_hostnames - if set to "yes" then the contents of ${rhost}
# is translated in its official host name.
#
# domain_strip - if set to "yes" the domain name part of the host
# is strippped when normalizing hostnames. This can be useful
# when using of the same maps in a multiple domain environment.
#
# normalize_slashes - is set to "yes" by default and will collapse
# multiple unescaped occurrences of "/" to a single "/".
#
# selectors_in_defaults, selectors_on_default - has a default value
# of "no". If set to "yes" then any defaults entry will be
# checked for selectors to determine the values to be used.
# selectors_in_defaults is the preferred option to use.
#
# ldap_base - has no default value. It must be set to the base dn
# that is used for queries if ldap is to be used as a map
# source.
#
# ldap_hostports - has no default value set. It must be set to
# the URI of the LDAP server to be used for lookups when
# ldap is used a map source. It may contain a comma or
# space seperated list of LDAP URIs.
#
# hesiod_base - the base name used for hesiod map sources.
#
# Additional configuration options added:
#
# linux_ufs_mount_type - set the default system filesystem type that's
# used for mount type ufs. There's no simple way to determine
# what the system default filesystem is and am-utils needs to
# be continually updated to do this and can easily get it wrong
# anyway.
#
#
# Define global options for the amd parser within autofs.
#
[ amd ]
#
# Override the internal default with the same timeout that
# is used by the override in the autofs configuration, sanity
# only change.
#
dismount_interval = 300
#
# map_type = file
#
# Overriding this can cause autofs to use less resources because
# it will use symlinks instead of bind mounts in certain cases.
# You should ensure that the autofs kernel module your using
# supports expration of symlinks for best results (although this
# appears to work reasonably well most of the time without the
# update).
#
# autofs_use_lofs = yes
#
# Several configuration options can be set per mount point.
# In particulr map_type, map_name, map_defaults, search_path,
# browsable_dirs, dismount_interval and selectors_in_defaults
# (not all of which are currently implemented, see above).
#
# Also, if a section for an amd mount point is defined here
# it isn't necessary to specify the format in the corresponding
# master map entry and the format will be inherited for type
# "auto" mounts.
#
# [ /expamle/mount ]
# dismount_interval = 60
# map_type = nis



F*ck, gerade hat sich nach dem korrekten herunterfahren meines QNAPs nun Automount wieder aufgehangen, sprich, ich komme noch nichtmal auf das Verzeichnis "/mnt" via ssh.

Im Syslog steht hierzu:

ec 22 22:56:32 RPI4-DNS-UNIFI automount[9791]: expiring path /mnt/QnapBackup
Dec 22 22:56:44 RPI4-DNS-UNIFI automount[9791]: could not umount dir /mnt/QnapBackup
Dec 22 22:56:44 RPI4-DNS-UNIFI automount[9791]: couldn't complete expire of /mnt/QnapBackup
Dec 22 22:57:08 RPI4-DNS-UNIFI automount[9791]: 5 remaining in /mnt
Dec 22 22:58:23 RPI4-DNS-UNIFI automount[9791]: 5 remaining in /mnt
Dec 22 23:00:05 RPI4-DNS-UNIFI automount[9791]: attempting to mount entry /mnt/desktop.ini
Dec 22 23:00:05 RPI4-DNS-UNIFI automount[9791]: key "desktop.ini" not found in map source(s).
Dec 22 23:00:05 RPI4-DNS-UNIFI automount[9791]: failed to mount /mnt/desktop.ini
Dec 22 23:00:05 RPI4-DNS-UNIFI automount[9791]: re-reading map for /mnt
Dec 22 23:03:05 RPI4-DNS-UNIFI kernel: [29868.371718] nfs: server 192.168.241.4 not responding, still trying
Dec 22 23:03:06 RPI4-DNS-UNIFI kernel: [29869.332521] nfs: server 192.168.241.4 not responding, still trying


Was jetzt mit "entry /mnt/desktop.ini" gemeint ist......  :o ?


Edith: musste jetzt neu booten, auch mit "kill" konnte ich autofs nicht stoppen, bzw. das Verzeichnis "/mnt" wieder zwecks Zugriff freigeben. Werde den Verdacht nicht los, das das Verzeichnis "/mnt" vom System irgendwie belegt ist. Habe Automount jetzt per auto.master in ein neues Verzeichnis "/automount" "verschoben. Werde beobachten...

LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Die Config, welche Du gepostet hast, ist nur ein Teil der Config.
master_map_name = /etc/auto.master
Währe beinahe Wichtiger

Noch ein Hinweis: Zum posten sind die Kommentarzeilen irrelevant, deshalb besser beim nächsten mal:
grep -v "^#"
Und die Leerzeilen händisch entfernen. (Bin aktuell irgendwie zu geschafft, um auch hierzu ein Konsolen Einzeiler zu geben)
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

Moin,

danke für den Tip, kannte ich noch nicht.

[ autofs ]
master_map_name = /etc/auto.master
timeout = 300
negative_timeout = 15
browse_mode = yes
mount_nfs_default_protocol = 3
logging = verbose
[ amd ]
dismount_interval = 300


grep -v "^#" /etc/auto.master
+dir:/etc/auto.master.d
+auto.master
/automount /etc/auto.qnap -timeout=15 --ghost
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Mhhh ... und was hast Du in folgendem?
/etc/auto.qnap
Und was hast Du im Verzeichnis /etc/auto.master.d
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

#23

/etc/auto.qnap
QnapBackup -fstype=nfs,rw,retry=0 192.168.XXX.6:/share/Backup/
Rpi4FHEM -fstype=nfs,async,rw,retry=0 192.168.XXX.7:/media/
BPiMedia -fstype=nfs,rw,retry=0 192.168.XXX.5:/media/


Das Verzeichnis "/etc/auto.master.d" ist leer
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

wie kommst Du auf "retry=0"?

Nehme mal in die Zeile vers=3 und async mit auf
Prüfe bitte, ob ich mich mit vers nicht verschrieben habe ....
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

#27
Retry=0 habe ich hierher: https://www.elektronik-kompendium.de/sites/raspberry-pi/2102221.htm

Async hatte ich bis gestern noch drin, aber dann hing sich ja autofs auf, nachdem das QNAP nicht mehr erreichbar war.

Du meinst nfsvers=3 auch noch zusätzlich in die /etc/auto.qnap aufnehmen ? Weil es ja schon in der /etc/autofs.conf drinsteht

War jetzt eine Zeitlang nicht da, in der Zwischenzeit wurde das QNAP + BPi heruntergefahren, und mit den jetzigen Einstellungen hat sich autofs nicht mehr aufgehangen. Das beobachte ich jetzt noch erst etwas bevor ich da nochmal rumfuddel  ::)

LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Also wenn es funktioniert ist es O.K.

Leider sagt Deine Quelle nicht, warum sie die Parameter setzt. retry=0 .... dafür sehe ich eigentlich keinen Grund (und auch auf die schnelle nichts in der offiziellen Doku)
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

Das sagt https://wiki.ubuntuusers.de/Autofs/ hierzu:

NFS-Freigabe
Zum Einbinden der NFS-Freigabe "Musik" auf dem Server (hier ein QNAP-NAS) mit der IP "192.168.1.101" eignet sich z.B. folgende Zeile in der Map-Datei /etc/auto.QNAP:

Musik -fstype=nfs,rw,retry=0 192.168.1.101:/Musik
Mit folgendem Eintrag in /etc/auto.master

/QNAP /etc/auto.QNAP --ghost
Wichtig ist in diesem Fall die mount-Option retry=0. Diese sorgt dafür, dass mount sofort aufgibt, falls der Server nicht erreichbar ist. Anderenfalls würde mount für zwei Minuten versuchen den Server zu erreichen und so lange blockieren. Dieses Verhalten ist an sich kein Problem. Wenn man aber ein Lesezeichen in Nautilus erstellt, so wird dadurch der Start von gnome sowie vielen gnome-Anwendungen (wie gedit) eben diese zwei Minuten lang blockiert. Das Dateisystem-Backend von gnome versucht anscheinend den Verzeichnisinhalt des Links abzurufen und muss dabei auf den von autofs gestarteten mount-Befehl warten. Läuft der Server, so ist der erste Zugriff sofort erfolgreich, und es tritt keine Blockade auf. Die Option --ghost erzeugt leere Dateiverzeichnisse für alle Shares, damit der Verbindungsaufbau auch nach einem Timeout wieder erzeugt werden kann (siehe SMB - Freigabe).
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Was ich aber immer noch nicht verstehe, warum der Rechner ein Problem hat, wenn das Ziel "weg" ist .. es sei denn, ein Software greift dauern zu und läuft "Amok" .... das müsste man aber mit den Bordmitteln (Sofern man mit ssh draufkommt) sehen ...
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

Genau das ist wahrscheinlich der springende Punkt. Es gibt nur ein Programm welches auf die gemounteten Verzeichnisse zugreift, und das ist "inaktiv", sprich, ich habe die Aktualisierung im Hintergrund deaktiviert.

Mit ssh kam ich drauf, konnte da aber nix (mangels Kenntnisse) erkennen. Es sah immer alles "normal" aus, ausser, das ich den Autofs.service nicht stoppen konnte, noch auf das Verzeichnis /mnt zugreifen konnte.

Aber wie gesagt, momentan sieht es scheinbar gut aus.
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Mal als Tipp, wenn es mal wieder hängt:
- Was sagen die üblichen Verdächtigen (top, free, iotop etc)
- Wartet ein Prozess auf IO (load per uptime rausfinden)
- Was greift zu? (lsof)
- Funktioniert manuelles unmounten (als root umount -f)
- .....

... Damit Du schon mal das Handwerkzeug hast ...
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

Danke, ich benutze in der Regel htop. Ob man manuell bei Autofs unmounten kann, hab ich noch nie probiert. Punkt 2+3 kannte ich noch nicht... mal einlesen, danke
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Man kann es, auch wenn man es "normalerweise" nicht tun sollte. Aber Dein System ist sowieso im Fehlerfalle nicht mehr "normal".
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Bartimaus

Moin und frohe Weihnachten,

soviel vorweg, es funktioniert noch immer  ;D....
Nur hat heute Nacht Autofs gegen 4Uhr für mind. 40min versucht auf die Freigaben zuzugreifen, und dabei das Log ziemlich voll geschrieben.
Kann man im nachhinein noch analysieren warum das so war ? Also meine SystemD-Timer waren es nicht...
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Was steht denn im  Log?
Man kann vieles ... nur braucht man dazu Info ...
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

 ;)

Dec 25 04:20:56 RPI4-DNS-UNIFI automount[1921]: attempting to mount entry /automount/QnapBackup
Dec 25 04:20:58 RPI4-DNS-UNIFI automount[1921]: mount(nfs): no hosts available
Dec 25 04:20:58 RPI4-DNS-UNIFI automount[1921]: failed to mount /automount/QnapBackup
Dec 25 04:20:58 RPI4-DNS-UNIFI automount[1921]: re-reading map for /automount
Dec 25 04:20:59 RPI4-DNS-UNIFI automount[1921]: attempting to mount entry /automount/BPiMedia
Dec 25 04:21:02 RPI4-DNS-UNIFI automount[1921]: mount(nfs): no hosts available
Dec 25 04:21:02 RPI4-DNS-UNIFI automount[1921]: failed to mount /automount/BPiMedia
Dec 25 04:21:02 RPI4-DNS-UNIFI automount[1921]: re-reading map for /automount
Dec 25 04:21:02 RPI4-DNS-UNIFI automount[1921]: attempting to mount entry /automount/BPiMedia
Dec 25 04:21:05 RPI4-DNS-UNIFI automount[1921]: mount(nfs): no hosts available
Dec 25 04:21:05 RPI4-DNS-UNIFI automount[1921]: re-reading map for /automount


Um ca. 2Uhr fing der Versuch an aufs Qnap zuzugreifen, dann der Switch auf den BPi... bis 4:42Uhr. Danach war Ruhe im Karton, bis der BPi gegen 10 per Timer gestartet und gemountet wurde. Sehe aber gerade im vorhergehenden Syslog, das es wohl der PlexMediaServer war. Mal sehen ob ich dem das austreiben kann...
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Naja ... wenn der Pi auf ein NFS zugreifen will, wo der "Host" weg ist, darf er zu recht "meckern".  Mann sollte Geräte, welche planmäßig "weg" sind, also wirklich Stundenweise, nicht dauerhaft mounten ...
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

genau dafür ist aber IMO autofs da. Umount wenn der HOST weg ist. (Funktioniert ja jetzt auch) Nur doof wenn dann noch eine Software darauf zugreifen will... das steht erstmal so nicht auf dem Plan. Hab im Plex jetzt was gefunden wo er von 02:00-05:00 irgendwelche Aktialisierungen durchführen will
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Autofs soll unmounten, wenn nicht zugegriffen wird. Nicht wenn der Host "weg" ist.

Hat natürlich den Vorteil, das im Ungemounteten Zustand ein reboot des QuellServers weniger Probleme bereitet.
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Bartimaus

Ja, einverstanden...... irgendwann finden wir einen gemeinsamen Nenner  ;D

In meiner Konfig ist es halt wichtig relativ schnell zu unmounten, damit nichts schiefgeht wenn der HOST verschwindet
LG
B.


FHEM@Intel-J4105@Debian-LXC, CUL1101,FS20,IT,DS18B20,DS2413(Heizungslogger),DS2423(Stromlogger)Homematic,HM-LAN,ZWave,MiniCULs,Shelly

Wernieman

Naja .... mag auch autofs bei Geräten, wo selten zugegriffen wird. Wenn aber der Quellserver geizielt abgeschaltet werden soll, z.B. wegen "Nachtabschaltung", sollte es eher über ein Script erledigt werden:

abschalten: sync, sleep, unmounten, sleep, Quelle Abschalten
anschalten: Quelle Anschalten, sleep, Testen ob Quelle da, mounten

Im Script dann auch Fehler abfangen und sich überlegen, was dann genau gemacht werden soll. z.B. wenn nicht ungemountet werden kann, Ziel einfach nicht abschalten?

Mach so etwas in meinem BackupScript. Dort sind es allerdings USB-Geräte. Hat im Backup noch den Vorteil: Wenn das Backup-Device nicht da ist, kann es nicht gelöscht werden ...
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html