Linux and NAS (magiea 5 and synology DSM6.1 report)

Ok, i own a synology DS215j (for Disk Station), got basic features, but never finished a good integration into mageia 5.
Here a testimony, with all the things I learnt during this journey, can also be considred as a short course about NAS, and also a step by step tutorial.
I still struggling on some points, but I hope to find some help on this thread. After, if we are happy, we could turn this into an "how to" on mageia wiki.
First, we need to make basics reminders to give a quick cathing-up on background concepts. So people in the know can skip this first post.
A NAS (Network attached Storage), is basically a computer, with a disk, offering storage service over a network. My mageia desktop, is also a computer, also with a disk, but needing extra storage service. So basically this is a client / server pattern, where magia desktop is the client and synology DiskSation is the server (everything is called a "station" in synology, but actually there are "server").
So DS215j is really a computer, with CPU (ARM based), RAM, with a SATA attachement for 2 disks, USB plugs, ethernet plug, etc. This computer need an Operating system, and guess what, it is a linux derivative, patched by synology developers. This OS is called DSM 6.1, for DiskStaionManager. This DSM propose various installable "paquet", that are actually applications, that propose client/server services : mail server, database server, web server, ftp server, album photo server, streaming multimedia (music and video) server, etc, on top of stored data. It does all this, on your LAN, but is also able to do it for your client, through internet. So it is more than a NAS, it could be seen as a "private cloud". But here, we will discuss (with some expections) only the "file server" service, and in a LAN context. So plain old NAS.
Ok, so a NAS is not a disk, it is a computer with a disk, as our desktop, plus a service to access it. Now I want to spend some time to explain how computers manage their disk. The disk is physically attached to the main board, by a bus with standard protocol to control it (SATA protocol in my case). This protocol allow to read or write block (via adressing mechanism) into the disk. And thats all. I mean the disk don't have any idea of what the blocks represent. There is no "file", "folder", "ownership" meaning in a disk, just "blocks of data", stored at a predefined adress. You can't aks a "file" to a disk.
The thing that put "meaningness" on those blocks is the Operating system that controls this mainboard and this disk attachement. The module that manage a represenation of structured data, that can be stored (via blocks) on a disk, is a "file system manager". Basically, a file system define a structuration of the disk, first partitioning area, then breaking down into logical pages (containing physical blocks or sectors of the disk), some pages having some special funtions, to access the structure. This structure is called a "disk partition", containing "file system format" : formatting a disk. A page can store "data" or "metada", that is information about stored data. A page also contains "pointers", to be linked to parent page or child pages. Thus a file, is a set of "pages" of data, linked in a particular order, each file has a metadata page storing information about the file (ownership, permission, date, size, etc). The filesystem also define the notion of "folder", a page containing "pointers" to belonging files, each files maitain also a pointer to its belonging "folder". The operating, export then syscall to control this new "entities" to programs : "create folder", "create file", "read page of a file", etc. Every Operating has at least one "file system manager" that allows to store its data and programs into a disk.
But generally, it supports several file systems. Linux for example has EXT-2-3-4, BTRFS, XFS and others, generally compatible with same POSIX file system manager syscall, implemented by a common layer in the kernel, called "VFS" for Virtual File System. Windows has also its file systems : FAT-16-32, NTFS. But, in the detailed implementation, and structuration, there are all differents. If you don't know what filesystem manager has used a disk, you can't undersatnd its content. Just to finish this presentation, linux understand windows file system, and so, in case you have a dual boot on your computer, you can access both linux or windows partitions of your local disks.
A running OS, manage the safely local disks, through its file system managers, and allows its users, to concurrently manage their files and folder, generally with a permissions controling their access.
In linux, OS export to user a unique and logical "file system" view, that can be composed of several physical partition. For this, we can "mount" a partion, containing folders and files, under a folder name into the "file system", this folder making the "glue" where the partion is expanded, is called the "mount point".
But what happens when you want to have into your file system, a partition that is not part to a disk attached to your computer and controler by the OS of your computer ? This is the purpose of "file service protocol", a client/server protocol that allows a client to include into its own local file systel view, an external partition managed by another machine over the network. So this is the 3 layer of this architcure : physical block echanges between kernel and disk, file and folder exchnage between program and local filesystem, and files and folder exchanges between 2 remote filesystem.
Windows as defined one file server protocol : SMB, now named CIFS. Linux, on the other hand uses NFS (Network file system).
Here a testimony, with all the things I learnt during this journey, can also be considred as a short course about NAS, and also a step by step tutorial.
I still struggling on some points, but I hope to find some help on this thread. After, if we are happy, we could turn this into an "how to" on mageia wiki.
First, we need to make basics reminders to give a quick cathing-up on background concepts. So people in the know can skip this first post.
A NAS (Network attached Storage), is basically a computer, with a disk, offering storage service over a network. My mageia desktop, is also a computer, also with a disk, but needing extra storage service. So basically this is a client / server pattern, where magia desktop is the client and synology DiskSation is the server (everything is called a "station" in synology, but actually there are "server").
So DS215j is really a computer, with CPU (ARM based), RAM, with a SATA attachement for 2 disks, USB plugs, ethernet plug, etc. This computer need an Operating system, and guess what, it is a linux derivative, patched by synology developers. This OS is called DSM 6.1, for DiskStaionManager. This DSM propose various installable "paquet", that are actually applications, that propose client/server services : mail server, database server, web server, ftp server, album photo server, streaming multimedia (music and video) server, etc, on top of stored data. It does all this, on your LAN, but is also able to do it for your client, through internet. So it is more than a NAS, it could be seen as a "private cloud". But here, we will discuss (with some expections) only the "file server" service, and in a LAN context. So plain old NAS.
Ok, so a NAS is not a disk, it is a computer with a disk, as our desktop, plus a service to access it. Now I want to spend some time to explain how computers manage their disk. The disk is physically attached to the main board, by a bus with standard protocol to control it (SATA protocol in my case). This protocol allow to read or write block (via adressing mechanism) into the disk. And thats all. I mean the disk don't have any idea of what the blocks represent. There is no "file", "folder", "ownership" meaning in a disk, just "blocks of data", stored at a predefined adress. You can't aks a "file" to a disk.
The thing that put "meaningness" on those blocks is the Operating system that controls this mainboard and this disk attachement. The module that manage a represenation of structured data, that can be stored (via blocks) on a disk, is a "file system manager". Basically, a file system define a structuration of the disk, first partitioning area, then breaking down into logical pages (containing physical blocks or sectors of the disk), some pages having some special funtions, to access the structure. This structure is called a "disk partition", containing "file system format" : formatting a disk. A page can store "data" or "metada", that is information about stored data. A page also contains "pointers", to be linked to parent page or child pages. Thus a file, is a set of "pages" of data, linked in a particular order, each file has a metadata page storing information about the file (ownership, permission, date, size, etc). The filesystem also define the notion of "folder", a page containing "pointers" to belonging files, each files maitain also a pointer to its belonging "folder". The operating, export then syscall to control this new "entities" to programs : "create folder", "create file", "read page of a file", etc. Every Operating has at least one "file system manager" that allows to store its data and programs into a disk.
But generally, it supports several file systems. Linux for example has EXT-2-3-4, BTRFS, XFS and others, generally compatible with same POSIX file system manager syscall, implemented by a common layer in the kernel, called "VFS" for Virtual File System. Windows has also its file systems : FAT-16-32, NTFS. But, in the detailed implementation, and structuration, there are all differents. If you don't know what filesystem manager has used a disk, you can't undersatnd its content. Just to finish this presentation, linux understand windows file system, and so, in case you have a dual boot on your computer, you can access both linux or windows partitions of your local disks.
A running OS, manage the safely local disks, through its file system managers, and allows its users, to concurrently manage their files and folder, generally with a permissions controling their access.
In linux, OS export to user a unique and logical "file system" view, that can be composed of several physical partition. For this, we can "mount" a partion, containing folders and files, under a folder name into the "file system", this folder making the "glue" where the partion is expanded, is called the "mount point".
But what happens when you want to have into your file system, a partition that is not part to a disk attached to your computer and controler by the OS of your computer ? This is the purpose of "file service protocol", a client/server protocol that allows a client to include into its own local file systel view, an external partition managed by another machine over the network. So this is the 3 layer of this architcure : physical block echanges between kernel and disk, file and folder exchnage between program and local filesystem, and files and folder exchanges between 2 remote filesystem.
Windows as defined one file server protocol : SMB, now named CIFS. Linux, on the other hand uses NFS (Network file system).