Finding out how to do this was a confusing mess. There are dozens (if not hundreds) of messages and blog posts describing how it should work, but none matched my situation enough to actually work for me. Amazingly, the search engine A.I.s were most helpful in figuring it out, but for those who prefer a human (I assume), this blog post has the important details:
I thought I would summarize the steps it takes to have a Synology NAS (like a DS1522+) user home directory on a Raspberry Pi.
Synology NAS Steps
My main system is a Mac and I enable the SMB service on my Synology NAS. This is the file sharing service that will let you access your NAS from a PC (“\\NASName”) or Mac (smb://NASName). On Mac, this is what lets me browse to my NAS through the Finder:

I find that a super-convenient way to do it since I can have my Mac always prompt me for a username and password, or have it remember them in the keychain/passwords app if I don’t want security. . .
1. Enable SMB
Log in to your Synology, then go to Control Panel -> File Services -> SMB Tab

Enable the SMB service. You can also specify a custom Workgroup name, such as “WORKGROUP.”
You may also want to enable the Bonjour service in the Advanced tab. That should make it show up to your Mac without having to know its IP address. For this demo, my NAS is named “DS1522” and Bonjour is what (I believe) makes that show up in my Finder.
2. Create a User on the Synology NAS
You can create a new user account which will have its own isolated home directory.
Control Panel -> User & Groups – Create Tab
You can create a new user account with its own password. I used my e-mail address so I can get any notifications (such as password reset).

After clicking Next, you get a chance to assign this new user to any specific groups. You should have “users / System default group” already checked. If not, make sure to check it.
On the next Next screen, make sure this new user has Read/Write Access to the homes group. You will want to check that one yourself:

The next few screens are for specific permissions. I left them at defaults since all I am using this account for is a shared folder. Eventually, it will Save and you will have the new user.
Now with this user created, you should be able to browse to it and login using that username and password and see the home folder. You can access it in Finder (if Bonjour is active) or type Command+K from a Finder window and enter “smb://” and the IP address of your NAS (“smb://10.0.0.1” or if it has a name, “smb://NASName”) and you should get prompted for a username and password:

Once connected, you should be able to get to that user’s home folder (under homest) and see whatever is is there Your new account will be empty, but I have already copied some files into mine. Those files are stored on my NAS, but I can connect and get to them from my Mac.

Now we will get the Raspberry Pi to connect and see those files, too.
Raspberry Pi Steps
The current Pi operating system has the stuff to do this built-in, but if you have an older OS, you may have to install some things. I can’t cover that, since I did not need to.
At this point, you should be able to mount the new user account on your Pi just by typing in a command like this:
sudo mount -t cifs //ds1522.local/homes/pi400 /home/allenh/DS1522/ -o username=pi400,workgroup=MYGROUP,rw,uid=$(id -u allenh),gid=$(id -g allenh)
- The “//ds1522.local” should be the name of your NAS or the IP address (if not using Bonjour). After that is the path to where the home folder for the new account is. Those are in “/homes/accountname”.
- The “/home/allenh/DS1522” is the destination where the folder will me mounted on the Raspberry Pi. In my case, my Pi account name is “allenh” and I wanted it in a folder called “DS1522” in my home folder there — “/home/allenh/DS15222”.
- After that, “username=” can be set with the user account to log in to, or just have “username=” if you want to b prompted for the username.
- Then comes where you could have also specified a password using “password=” and the password. But that shows your password to anyone able to see you typing on the screen.
- You then give whatever workgroup name you set up in SMB sharing on the Synology NAS.
- After that, I found I had to include the “rw” read/write flag, else I could only read files, and if I tried to write anything out I got a Permission Error.
- The next bit with “uid” (user I.D.) and “gid” (group I.D.) may or may not be necessary, but after mine only gave me READ access, I asked some of the A.I.s and they suggested that and it worked. I don’t really know what that is for, but “it worked for me.”
After this, you should get prompted for the password of that Synology account, and then you should see that remote home folder appear on your PI.
Un-mounting
To unmount/release this mapped in folder, use “sudo umount -l /home/allenh/DS1522“.
If you forget what all you have mounted, you can type “df -h” to see a list of all things mounted to the Pi.
Scripting
To make things easier, I created a simple shell script called “mountnas.sh” that contains the command I use. I also made an “unmount.sh” script with the unmount command.
Now, if my Pi is on the same network as my NAS, I can just run one of those scripts or type the command and get that folder mounted so I can read/write files to it from my Pi.
Hope this helps…