Let us continue with more "traditional" linux NAS integration (not with cloed source applciations).
What I should have explained first, is how to
integrate synology with MCC wizards, xhich is the "historical" mageia way.
Launch Mageia Control Center / Network shares (en francais Paratge réseaux, you have guess I was not English -soory for my poor skills- so, can't tell the exact labels in english version).
We have 3 options to configure remote storage access :
1) windows samba (cifs)
2) unix NFS
3) webdav
Before to walktrough, I recall that we consider magiea as the client. So our purpose it to import NAS share locally, and not export our file system to outside.
I realized I never talk about webdav :
https://en.wikipedia.org/wiki/WebDAVThere is a quick tutorial on webdav usage at synology :
https://www.synology.com/en-uk/knowledg ... ith_WebDAVOk, so you need to insatll a kind of webserver on your NAS, that will export the local (NAS) filesystem through this web protocol. So, you need to autheticate to NAS, so same credential as when you use the general "web client".
Ok, to finish this webdav introduction, you can look at KDE integration :
http://docs.basex.org/wiki/WebDAV:_KDEThat all, for webdav for the moment, I want to spend more time on CIFS and NFS, that are more traditionnal approach of file system integration.
So let resume with MCC wizard, here the online doc of "diskdrake' (also in mageia do of course) :
https://doc.mageia.org/mcc/4/en/content ... aring.htmlMy first idea was to use CIFS client, I will discuss this point later. So how diskdrake manage my CIFS integration ? Not well. At first attempt the discovery didn't find any server. In the MCC, in the "network and internet", host definitions can help.
know, the server is listed, but no share point is presented. Not normal.I launched samba-client to see if my CIFS conf was visible.
- Code: Select all
[jacques@localhost testSyno]$ smbclient -L XXX
Enter jacques's password:
Domain=[JACKYNAS_WG] OS=[Windows 6.1] Server=[Samba 4.4.13]
Sharename Type Comment
--------- ---- -------
homes Disk user home
music Disk System default shared folder
photo Disk System default shared folder
testFolder Disk jsut for testing purpose
IPC$ IPC IPC Service ()
video Disk System default shared folder
home Disk Home directory of jacques
Domain=[JACKYNAS_WG] OS=[Windows 6.1] Server=[Samba 4.4.13]
Server Comment
--------- -------
XXX
Workgroup Master
--------- -------
XXX_WG
[jacques@localhost testSyno]$
So, a samba client sees my NAS (XXX), diskdrake seems to have a bug, I did'nt declare it in mageia's bugzillza (but I should). One possible explanation is that I have 2 windows workroup in my LAN. One, with default name WORKGROUP, is managed by my internet access box, but I declared my NAS as another workgroup, so perhaps it confuse the windows discovery.
Then I made another test with synology settings, in DSM / control Panel / Files services : SMB.
SMB must be enabled of course, but in Advanced Settings, check "Enable Local Master Browser", then Apply .
NB : doing this, enable Guest account, on DSM, I am not sure this is a good idea, so, I will revert after the configuration.
Tada ! diskdrake can now see the NAS shares !
Well, to be sure, I revert the "Local Master Browser", apply, and then, it still worked. Very strange, the only other I have done, is that start my wife windows laptop (by chance). This is perhaps this machine that provide some netbios support in my network (I know it has impact, because my samba client now also see the WORGROUP of my box, that was not the case before. Another explanation, is that discovery takes sometimes. I don't know... It is strange.
If I shutdown the windows laptop, it is still working.
Well, know I can foolow the procedure to setup a samba share, I mount all my shares, letting mageia proposing mount point, I also let him save fstab. I will explain that.
Some part are a bit tricky. If you let user = %, the system will ask at boot, or you will be notified by a system message, at the console, you can read that :
- Code: Select all
[jacques@localhost ~]$
Broadcast message from root@localhost (Sat 2017-07-01 23:50:23 CEST):
Password entry required for 'Password for %@//YYNAS/homes:' (PID 5554).
Please enter password with the systemd-tty-ask-password-agent tool!
I don't know how to manage this agent for the paswword. what I propose is to enter your NAS password in USERNAME, and then open advance option, enable "user" option (it will select several option). Then, in other, enter PASSWORD=YOUR_NAS_PASSWORD.
Then click on "mount", it should work (but it doesn't for me). To finish, let diskdrake save your settings in fstab. It will create a line like this :
- Code: Select all
//YOURNAS/homes /mnt/homes cifs user,credentials=/etc/samba/auth.YOURNAS.YOURUSERNAME 0 0
So why it doesn't work, as a user type thsi :
- Code: Select all
[jacques@localhost ~]$ mount /mnt/homes
error 13 (Permission denied) opening credential file /etc/samba/auth.YOURNAS.YOURUSERNAME
[jacques@localhost ~]$
It is normal, this file is owned by root with r+w permission.
Alternately, in dolphin (KDE file explorer), you now see your NAS mount point in the left panel, ilf you click ont it you also have an errot message :
- Code: Select all
Une erreur est survenue en accédant à « homes on jackynas ». Le système a répondu :error 13 (Permission denied) opening credential file /etc/samba/auth.jackynas.jacques
Before I continue, i want also to show you where you can have error inforation. You can look at /var/log files. Especially, CIFS client and filestem modules are running inside the kernel, so you can look (as root)
- Code: Select all
[root@localhost log]# tail -15 kernel/errors.log
Jul 2 00:13:15 localhost kernel: [ 4096.174028] CIFS VFS: cifs_mount failed w/return code = -13
Jul 2 00:13:52 localhost kernel: [ 4133.571145] CIFS VFS: cifs_mount failed w/return code = -13
Jul 2 07:22:47 localhost kernel: [ 3.367516] nouveau 0000:03:00.0: unknown chipset (118010a2)
OK, I want to stop here, for several reasons :
- I have made a change in my conf (i will explain), so perhaps you don't have exactly the same issue as me,
- I want to explain fsatb, and mount things, this is imprtant to understand
- Resolving this bug, risk to be lon in this tutorial, and perhaps it will discourage readers, although there is another integration pattern that appear to be simplier.
I promise I will come back on this "diskdrake" session, but believe me, after this first "blocking" situation on "CIFS", you will also find a "blocking" situation in NFS, and Webdav (that i never tried), seems to be a kind a "workaround", for me. So, it really the time to stop this part.
But before I switch, and to be equal among the 3 methods : CIFS, NFS, WEBDAV, I want to introduce NFS.
NFS is the more "straightforward" filesystem integration for linux, as this is the "Network File System" created for UNIX world. It is not the case in an "interorable" environment, but we will discuss this later. I just want to show you some piece on NFS integration with "diskdrake". I want to warn you that finally I decided to turn off NFS, at least to main shares. I will explain later, so the idea here is just to give a quick feedback with MCC wizard, it is not my final recommandation.
I want first to tell you I am surprise that now wizard work well (it is the first time, so i made something special with my recent actions), so it is very important that your NAS can be visible as a server to scan. For example, i added an alias in hte host "definition", this is perhaps it works ? Alternatvely, changing SMB setting on NAS forced a network service, so perhaps restart or reboot or NAS can help to configure correctly the NAS...
If you try to google synology and linux, you will find this NFS tutorial :
https://www.synology.com/en-uk/knowledg ... etwork_NFS So, go to control panel, activate one share, put a network filtering scheme (I used hostname mechanism for this, your NAS need to resolve this hostname, so your mageia laptop must be "named" and binded to IP, see you internet box for DHCP/DNS settings).
Ok, resume the wizard. it is straightforward. Seems to work.
For example, you can go to a console and list your mounts points :
- Code: Select all
[jacques@localhost mnt]$ cd /mnt
[jacques@localhost mnt]$ ls
homes/ music/ photo/ testFolder/ testfolder2/ testhomejacques/ testhomemarie/ video/
For this section, i made a test with "testfolder2" and this mount point folder appears "like a normal folder", as it is higlighted with a green background color, the inactive shares appreas just "blue" on black background.
Now, this mount point appears in "Dolphin", as well as other "CIFS mount points". But if I want to access, I have an error.
Note by the way that you can not use same "mount point" twice. This is why I create a "testfolder2" mount point, the prior version is used by "CIFS" moutn point. Huh, you think, is is a smat idea to access the same share with 2 different protocols ? well, good point. I had the same worry, checked on google, and it seems that DSM6.1 manage safely concurrent service of one share with both CIFS and NFS, it poses questions, but at least it is safe. We will discuss this later.
Ok, back to our error, I have made a msitake when I quick and dirty created the testfolder2 directory, look at the permissisn :
- Code: Select all
[jacques@localhost mnt]$ ls -al
total 44
drwxr-xr-x 10 root root 4096 juil. 2 10:33 ./
drwxr-xr-x 20 root root 4096 août 22 2015 ../
drwxr-xr-x 2 root root 4096 juin 10 11:13 homes/
drwxr-xr-x 2 root root 4096 juin 10 11:13 music/
drwxr-xr-x 2 root root 4096 juin 10 11:13 photo/
drwxr-xr-x 2 root root 4096 juil. 1 22:57 testFolder/
d--------- 4 nobody nobody 4096 juin 18 20:28 testfolder2/
drwxr-xr-x 2 root root 4096 juin 10 22:39 testhomejacques/
drwxr-xr-x 2 root root 4096 juin 10 23:58 testhomemarie/
drwxr-xr-x 2 root root 4096 juin 10 11:13 video/
as root, gives more privilege to this mount point (you have to unmount before, look at the special button in diskdrake) :
- Code: Select all
[root@localhost log]# chmod 755 /mnt/testfolder2/
[root@localhost log]# ls -al /mnt/
total 40
drwxr-xr-x 10 root root 4096 juil. 2 10:33 ./
drwxr-xr-x 20 root root 4096 août 22 2015 ../
drwxr-xr-x 2 root root 4096 juin 10 11:13 homes/
drwxr-xr-x 2 root root 4096 juin 10 11:13 music/
drwxr-xr-x 2 root root 4096 juin 10 11:13 photo/
drwxr-xr-x 2 root root 4096 juil. 1 22:57 testFolder/
drwxr-xr-x 2 root root 4096 juil. 2 10:33 testfolder2/
drwxr-xr-x 2 root root 4096 juin 10 22:39 testhomejacques/
drwxr-xr-x 2 root root 4096 juin 10 23:58 testhomemarie/
drwxr-xr-x 2 root root 4096 juin 10 11:13 video/
Ok, this is clean now, re-mount the share.
So ok, now you can see your share with Dolphin, if this is a test share like me, with empty content, and you did the same action to mount it, then I will demo a quick thing with privilege.
Try to create a text file with dolphin in your testfolder2 mount point ? You can't, when you ricght click to create a new text file, the action is invalid. This is because you created a mount point as "root" (MCC has root uid), and your KDE session is (normally) a regular user (jacques in my case).
If I try to this the same with the console :
- Code: Select all
[jacques@localhost mnt]$ touch /mnt/testfolder2/testfile
touch: impossible de faire un touch « /mnt/testfolder2/testfile »: Permission non accordée
[jacques@localhost mnt]$
So in english, I have not suffiant privilege. But look more carefuly what you have in term of priviege, in your local file system :
- Code: Select all
[jacques@localhost mnt]$ ls -al /mnt/testfolder2/
total 16
drwxr-xr-x 5 nobody nobody 4096 juil. 2 10:58 ./
drwxr-xr-x 10 root root 4096 juil. 2 10:33 ../
d--------- 2 nobody nobody 4096 juin 18 20:28 #recycle/
drwxrwxrwx 2 nobody nobody 4096 juil. 2 10:58 test/
It is interesting to see that the mount point is owned by "root", but other file are owned by "nobody".
If I create a file :
- Code: Select all
[root@localhost ~]# touch /mnt/testfolder2/roottesfile2.txt
[root@localhost ~]# ls -al /mnt/testfolder2/
total 16
drwxr-xr-x 5 nobody nobody 4096 juil. 2 11:15 ./
drwxr-xr-x 10 root root 4096 juil. 2 10:33 ../
d--------- 2 nobody nobody 4096 juin 18 20:28 #recycle/
-rw-r--r-- 1 nobody nobody 0 juil. 2 11:15 roottesfile2.txt
-rw-r--r-- 1 nobody nobody 0 juil. 2 11:13 roottesfile.txt
drwxrwxrwx 2 nobody nobody 4096 juil. 2 10:58 test/
[root@localhost ~]#
I see it as "nobody". Now, login as admin into your NAS (to see all files) by the wen, and use the "FileStation" to see this share :
rootfiles are owned by "root", as well as "#recycle". But "test" folder is owned by NAS admin user (that is not called root, nor nobody). test folder has been created inside the share, from the remote filesystem (using "File Station", at this time I was connected as admin, so it is logical. But, you should note, that even is permission are consistant, ownerships differ.
Just mark this in your memory, we will explain that later...
I promise I will come back on this "diskdrake" session, but believe me, after this first "blocking" situation on "CIFS", you will also find a "blocking" situation in NFS, and Webdav (that i never tried), seems to be a kind a "workaround", for me. So, it really the time to stopt this part about wizard, and continue our tutorial.