How to mount QNAP file share with fstab on Ubuntu 18.04
- Create a mount location on your Ubuntu host.
sudo mkdir /media/<sharename>
2. Create a credentials file (I created mine at /media/nfs-credentials with sudo touch /media/nfs-credentials and put the following lines in the file.
username=<shareusername>
password=<sharepassword>
Edit /etc/fstab and add a line at the bottom being careful not to edit any lines that already exist.
//<share_ip>/<sharename> /media/<sharename> cifs uid=0,credentials=/nfs/nas-credentials,iocharset=utf8,noperm 0 0
Test your mount with the following command:
sudo mount -a
Navigate to /media/<sharename> and you should see the contents of your share.
Your share will automatically mount at system boot from now on.