The shared folder is synchronized with Google Drive using the Cloud Sync application of the Synology NAS and thus allows Google Drive to be synchronized with the RPI
<p><strong>2. On the Synology NAS host</strong><br/>
--> Create the shared folder <em><spanstyle="color: #4769A1">FOLDER</span></em> on the NAS<br/>
--> Sync the <em><spanstyle="color: #4769A1">FOLDER</span></em> folder with a folder on Google Drive using Cloud Sync<br/>
--> Set NFS permissions on the shared folder for the RPI with read/write access for wired and wireless RPI addresses<br/>
<br/>
<strong>3. On the client RPI</strong><br/>
In the example, user = <em><spanstyle="color: #4769A1">raspi</span></em><br/>
--> Update the package database
</p>
<pre>
<code>sudo apt update
</code>
</pre>
<p>--> Upgrade the system</p>
<pre>
<code>sudo apt full-upgrade
</code>
</pre>
<p>--> Create a <spanstyle="color: #4769A1">folder</span> directory for mounting</p>
<pre>
<code>sudo mkdir /home/raspi/folder
</code>
</pre>
<p>--> Granting all rights on the mounting <em><spanstyle="color: #4769A1">folder</span></em> and the files of the folder.</p>
<pre>
<code>sudo chmod -R 777 /home/raspi/dossier
sudo chown -R raspi:raspi /home/raspi/dossier
</code>
</pre>
<p>--> Create a <em><spanstyle="color: #4769A1">Scripts</span></em> folder for the mounting script</p>
<pre>
<code>sudo mkdir /home/raspi/Scripts
</code>
</pre>
<p>--> Create the <em><spanstyle="color: #4769A1">mount-folder.sh</span></em> file for mounting with Geany
</p>
<pre>
<code>sudo geany
</code>
</pre>
<p>--> Enter the code into Geany<br/>
In the mount, the <em><spanstyle="color: #4769A1">-t </span></em> (type) option should be followed by the used protocol, here <em><spanstyle="color: #4769A1">nfs</span></em><br/>
Replace <em><spanstyle="color: #4769A1">xxx.xxx.xxx.xxx</span></em> with the correct value
</p>
<pre>
<code>#/bin/bash
sudo mount -t nfs xxx.xxx.xxx.xxx:/volume1/FOLDER /home/raspi/folder
</code>
</pre>
<p>--> Save in the <em><spanstyle="color: #4769A1">/home/raspi/Scripts</span></em> directory with the name <em><spanstyle="color: #4769A1">mount-folder.sh</span></em>
</p>
<p>--> Create the service file <em><spanstyle="color: #4769A1">mount-folder.service</span></em> for mounting with Geany for startup automation
</p>
<pre>
<code>sudo geany
</code>
</pre>
<p>--> Enter the code into Geany</p>
<pre>
<code>[Unit]
# Description of service: Mount NAS folder
Description=Mount NAS folder
# This service will start after the network is available
After=network-online.target
[Service]
# Command to execute to start the service: execute the bash script to mount the NAS folder
<p>--> Save in the <em><spanstyle="color: #4769A1">/etc/systemd/system/</span></em> directory with the name <em><spanstyle="color: #4769A1">mount-folder.service</span></em>
</p>
<p>--> Enable the <em><spanstyle="color: #4769A1">mount-folder.service</span></em> file</p>
<pre>
<code>sudo systemctl enable mount-folder.service
</code>
</pre>
<p>--> Reboot the RPI
<pre>
<code>sudo reboot
</code>
</pre>
The mounted folder appears on the RPI desktop.<br/>
The script can be adapted depending on the NAS used and provides the basic principle.