First, you’ll need to create a folder as the mount point. Let’s say that you want to mount folder. As an example, let’s create a folder named NAS under the /mnt directory. Open up a terminal (naturally) and execute:
sudo mkdir /mnt/NAS
sudo chown your_username /mnt/NAS
Replace your_username with your actual username. This will give you the ability to write in what you mount.
First, let’s make sure you have the necessary filesystem installed:
sudo apt install cifs-utils
mount -t cifs -o username=YOURUSERNAME,password=YOURPASSWORD //server_ip_address/folder_to_mount /mnt/NAS/
Replace YOURUSERNAME and YOURPASSWORD with the credentials you use for your NAS. Same for the server_ip_address and folder_to_mount. If you want to mount the entire NAS, just use //server_ip_address/ without a folder. Don’t forget the /mnt/NAS part.
Once you do that, your NAS will automatically mount on the designated location. Then you can navigate via your file manager (from Computer or Other locations > Filesystem), enter the mnt folder and drag and drop the NAS folder to your left bar to create a bookmark.
However, this will revert the moment you reboot. So, we’ll need to add a line in the file that mounts all filesystems at boot.
First, create a credentials file.
sudo nano /etc/smb-credentials
In the new file, type:
Replace the values as appropriately.
Now, to create the permanent on-boot mount.
sudo cp /etc/fstab /etc/fstab.backup
Just being cautious here!
Then, type in:
sudo nano /etc/fstab
Go to the end of the file and type in:
//server_ip_address/folder_name /mnt/NAS cifs credentials=/etc/smb-credentials,file_mode=0755,dir_mode=0755 0 0
The same goes here for the server_ip_address, folder_name. Replace them with the actual values.
Press CTRL+O, then Enter to save. Then CTRL+X to exit.
Next time you reboot, your NAS will be auto-mounted at the /mnt/NAS.
Remember, if you do any reset and your NAS’ IP changes, you will have to update the /etc/fstab file with the new IP address.