Network shares from the NAS, computer or a USB disk on the router can be easily reached, opened and mounted under Linux via the file manager - but they are gone again after the next system start. The solution may seem ugly to anyone used to Windows, but it's terribly simple: a small entry in a text file. For our example, a virtual Ubuntu with LXDE desktop is used and a folder with series from the QNAP NAS is to be integrated. Of course, the whole thing works exactly the same way with a folder that has been released under Windows via the context menu.
Addendum: In the meantime, May 2019, permanent integration also works via many file managers, for example under Ubuntu with Gnome desktop. We'll show you how here. But be careful: You have fewer options there than with fstab, of course ;). So actually none...
1. Create mount point
The release is included in a folder, so it creates the "Series" folder in the user folder, for example. By default, the /mnt and /media directories are chosen (for example, Ubuntu automatically creates a desktop icon for folders in /media).
2. Link folders
Open a terminal and give the command
sudo gedit /etc/fstab
to open the "fstab" file with the text editor "gedit" - alternatively you can of course also use nano, vi, emacs or any other editor. Enter a line like this at the end of the file:
//192.168.178.23/Serien /home/benutzername/Serien cifs defaults,username=deinname,password=deinpasswort
The first path specifies the NAS folder, the second the mount point folder just created, cifs stands for Common Internet File System and sets the protocol, defaults sets the standard settings for cifs and the login data are self-explanatory Login data can also be swapped out and addressed with "credentials=/path/to/smbcredentials 0 0", whereby the "smbcredentials" file only has to contain two lines with "username=yourname" and "password=yourpassword". Part of the defaults setting is also the automatic mounting of the folder at the next start.
UPDATE: If you write access to the network folders for normal users (i.e. without root), you can explicitly specify the desired user:
//192.168.178.23/Serien /home/benutzername/Serien cifs defaults,uid=1000,username=deinname,password=deinpasswort
The uid=1000 give the ID of the local user who should have write access. That has nothing to do with that username of the user on the remote computer! You can find the ID of the user via id -a username out of here. Instead of uid you can too gid use for groups.
3. Integrate network shares immediately
A restart is not necessary at all
sudo mount -a
it is enough to read in the fstab again and the release ends up in the mount point and, depending on the system, also on the desktop or in the navigation bar of the file manager.