ubuntuusers.de

Autofs für smb share

Status: Gelöst | Ubuntu-Version: Ubuntu 24.04 (Noble Numbat)
Antworten |

orloff34

Avatar von orloff34

Anmeldungsdatum:
13. Februar 2013

Beiträge: 23

Hallo liebe community,

ich musste meinen Rechner neu aufsetzen nach dem dem das Upgrade auf Ubuntu 24.04.1 schief ging. Ich habe ein NAS System im lokalen Netz, welches ich bisher mit autofs eingebunden habe. Jetzt funktioniert das nicht mehr und ich kann mir nicht erklären warum. Kann mir jemand weiter helfen?

cifs-utils habe ich installiert mit

1
sudo apt-get install cifs-utils

Analog zum zu dem was bisher funktionierte sieht /etc/auto.nas wie folgt aus:

1
2
3
"Bilder auf ODROID-HC1" -fstype=cifs,uid=1000,credentials=/home/thomasb/.davfs2/smbcredentials ://192.168.178.12/Bilder
"Home auf ODROID-HC1" -fstype=cifs,uid=1000,credentials=/home/thomasb/.davfs2/smbcredentials ://192.168.178.12/homes
"Multimedia auf ODROID-HC1" -fstype=cifs,uid=1000,credentials=/home/thomasb/.davfs2/smbcredentials ://192.168.178.12/Multimedia

Und die /etc/auto.master sieht wie folgt aus:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# 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
/home/thomasb/mnt/ODROID-HC1 /etc/auto.nas --timeout=60 --ghost
#
# 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
# To add an extra map using this mechanism you will need to add
# two configuration items - one /etc/auto.master.d/extra.autofs file
# (using the same line format as the auto.master file)
# and a separate mount map (e.g. /etc/auto.extra or an auto.extra NIS map)
# that is referred to by the extra.autofs file.
#
+dir:/etc/auto.master.d
#
# If you have fedfs set up and the related binaries, either
# built as part of autofs or installed from another package,
# uncomment this line to use the fedfs program map to access
# your fedfs mounts.
#/nfs4  /usr/sbin/fedfs-map-nfs4 nobind
#
# 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

Die Datei /home/thomasb/.davfs2/smbcredentials

1
2
3
username=xxxxx
password=yyyyy
domain=//192.168.178.12

Damit die smbcredentials nur vom Besitzer eingesehen werden kann, habe ich die Rechte entsprechend mit chmod 600 /home/thomasb/.davfs2/smbcredentials geändert.

Wenn ich das System neu starte, kann ich nicht auf den mountpoint /home/thomasb/mnt/ODROID-HC1 zugreifen, da root der Besitzer ist.

Was muss ich ändern, damit es wieder funktioniert?

Vielen Dank und viele Grüße

orloff34

(Themenstarter)
Avatar von orloff34

Anmeldungsdatum:
13. Februar 2013

Beiträge: 23

Ich habe das Problem gelöst. Man braucht gar kein Autofs mehr. Folgender Eintrag in /etc/fstab hat den gleichen effekt und erzeugt automatisch eine automount unit:

//192.xxx.xxx.xx/Bilder /mnt/ODROID/Bilder cifs rw,uid=1000,noauto,nofail,credentials=/home/xxxx/.smb/smbcredentials,x-systemd.automount,x-systemd.idle-timeout=60s  0 0
//192.xxx.xxx.xx/homes /mnt/ODROID/Home cifs rw,uid=1000,noauto,nofail,credentials=/home/xxxx/.smb/smbcredentials,x-systemd.automount,x-systemd.idle-timeout=60s  0 0
//192.xxx.xxx.xx/Multimedia /mnt/ODROID/Multimedia cifs rw,uid=1000,noauto,nofail,credentials=/home/xxxx/.smb/smbcredentials,x-systemd.automount,x-systemd.idle-timeout=60s  0 0

Mit foögenden Befehl kann der Status der z.B. für Home und analog für die anderen shares abgefragt werden:

systemctl status mnt-ODROID-Home.automount

Gruß Orloff34

Antworten |