Hallo zusammen,
auf meinem 16.04 möchte ich 2 Ordner meines NAS einbinden (d.h. auf diese lesend und schreibend mit Nemo/VLC/Rhythmbox zugreifen). Einen Ordner (A) einzubinden hat vor einiger Zeit wunderbar funktioniert, ich weiß leider nicht mehr genau, wie ich das gemacht habe, dazu gleich mehr. Nun möchte ich einen zweiten Ordner (B) einbinden. Mit fstab funktioniert das leider nicht. Mit folgendem Befehl geht es jedoch (alles, was im Folgenden in eckigen Klammern steht, ist anonymisiert und entspricht bei mir natürlich den gewollten Werten):
1 | sudo mount -t cifs -o credentials=~/.smbcredentials,uid=1000,gid=1000 //[NAS IP]/[Ordnerpfad] /media/[existierender Ordner] |
–> heißt für mich: prinzipiell Zugriff möglich, d.h. Credentials stimmen, Pfad am NAS, auf dem Ubuntu-Rechner etc.
Meine fstab sieht so aus:
# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda6 during installation UUID=[UID] / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=[UID] none swap sw 0 0 //[NAS IP]/[Ordnerpfad A] /home[Username]/[existierender Ordner] cifs credentials=~/.smbcredentials,iocharset=utf8,uid=1000,gid=1000 0 0 //[NAS IP]/[Ordnerpfad B] /media/[existierender Ordner] cifs credentials=~/.smbcredentials,iocharset=utf8,uid=1000,gid=1000 0 0
Das merkwürdige daran ist, dass Ordner B selbst dann korrekt beim Start gemounted wird, wenn ich die Zeile in fstab auskommentiere. Mir scheint, als wenn ich das irgendwie anders gemacht habe.
Ich habe Autofs als Möglichkeit gefunden, glaube aber nicht, dass ich das darüber gemacht habe, wegen Inhalt folgender Dateien:
/etc/default/autofs:
# # Init syatem options # # If the kernel supports using the autofs miscellanous device # and you wish to use it you must set this configuration option # to "yes" otherwise it will not be used. # USE_MISC_DEVICE="yes" # # Use OPTIONS to add automount(8) command line options that # will be used when the daemon is started. # #OPTIONS="" #
(Schöner Typo in der ersten Zeile übrigens)
/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 # # 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
(/etc/auto.cifs-shares ist leer)
Fragen:
Wie kann ich herausfinden, wie Ordner A gemounted wird?
Wie kann ich Ordner B am besten mounten (fstab oder autofs)?
Sonstige Angaben: NAS ist über WLan verbunden, per Browser unter der IP und Nutzername/Kennwort erreichbar, Ordner sind freigegeben
1 | Umount /home[Username]/[existierender Ordner] |
funktioniert, NAS-Ordner ist nicht mehr erreichbar (d.h. Ordner ist leer), wird aber nach Neustart wieder automatisch eingebunden (d.h. ist über Nemo unter /home[Username]/[existierender Ordner] erreichbar) Habe auch schon versucht Ordner A und B beide unter /home/[Username] und unter /media/[Ordner] einzubinden, gleiches Resultat wie oben.
Edit: Auszug aus "mount"-Ausgabe für Ordner A:
//[NAS IP]/[Ordnerpfad A] /home[Username]/[existierender Ordner] type cifs (rw,relatime,vers=1.0,cache=strict,username=[username], domain=[Domain, ist nicht in .smbcredentials enthalten],uid=1000,forceuid, gid=1000,forcegid,addr=[NAS IP],file_mode=0755,dir_mode=0755,nounix,serverino, mapposix,rsize=61440,wsize=65536,actimeo=1)
Edit2: Versuch mit Autofs zu mounten: Autofs ist installiert. Inhalt /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 # # 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 /mnt/shares /etc/auto.cifs-shares -t=0
Inhalt /etc/auto.cifs-shares:
[Ordnername B] -fstype=cifs,uid=1000,retry=0,gid=1000,credentials=~/.smbcredentials ://[NAS IP]/[Ordnerpfad B] [Ordnername A] -fstype=cifs,uid=1000,retry=0,gid=1000,credentials=~/.smbcredentials ://[NAS IP]/[Ordnerpfad A]
Ergebnis: nichts wird eingebunden (außer des mysteriösen /home/[Username]/[Ordner A], bei dem ich immer noch nicht weiß, wodurch das Mountenangestoßen wird). Allerdings dauert das Herunterfahren sehr lange (>10 Minuten), die Puntanimation mit dem Ubuntu-Schriftzug ist aktiv und irgendwann startet der Rechner neu bzw. fährt herunter.
Besten Dank an alle, die meinen Beitrag gelesen haben. Ach so: Ich bin relativ neu bei Linux und habe nur wenig selber konfiguriert, glaube also, dass das meiste andere Standard ist.