Technical Anshu
Tutorials Blog
NAS Guide

Mount a NAS Share in Ubuntu With the Same Fstab Recipe

If you can mount a Windows share permanently, you can mount a NAS share - the recipe is the same line, the same credentials file, the same safety options. What changes is the other end: a NAS has its own accounts, its own address habits, and one SMB setting worth knowing about.

Technical AnshuUbuntu and WindowsStep-by-step guide
Watch the video for the complete process shown live, step-by-step

People expect NAS mounting to be its own discipline. It is not. A Synology or QNAP shared folder speaks SMB exactly like a Windows share, so Ubuntu treats it identically: cifs-utils, a mount point, a credentials file, one line in /etc/fstab with _netdev and nofail, ownership presented with uid and gid. Everything from the core guide in this series carries over word for word. What does not carry over is the server side. The NAS is a small computer with its own user list, an address your router may keep changing, and SMB settings of its own - and those three quirks are where NAS mounts succeed or fail.

/etc/fstab - a NAS share mounted permanently (example)
The same recipe, NAS flavour (example line)
//192.168.1.50/FamilyDocs /mnt/FamilyDocs cifs credentials=/root/.nascredentials,_netdev,nofail,uid=1000,gid=1000 0 0
✓ A fixed IP address instead of a name - the NAS is found even when name discovery is asleep
✓ Its own credentials file - the NAS account is not your Windows account
Example line. Every piece of it is borrowed from the Windows recipe - only the address and the credentials file are NAS-specific.
1

Step 1 - What Stays Exactly the Same

Do not learn a second method. The Ubuntu side of this page is the core guide: install cifs-utils, make the mount point with sudo mkdir -p /mnt/FamilyDocs, test the mount once by hand, test with mount -a, reboot last. The safety rules travel too - the password lives in a credentials file with 600 permissions, never in the fstab line, and the mount is presented as your user with uid and gid. If any step is unclear, the core guide explains it fully; this page covers only what a NAS changes.

  1. One genuinely new file: a separate credentials file for the NAS, for example /root/.nascredentials - because the NAS account is a different account with a different password
2

Step 2 - Quirk One - Give the NAS a Fixed Address

A router hands out addresses by DHCP, and a NAS that reboots after an update can come back with a different one - at which point every mount pointing at the old address fails mysteriously. Names are the usual alternative, and names like the NAS's network name often work, but name discovery across a home network can be slow or inconsistent, especially after sleep.

  1. In your router's settings, add a DHCP reservation for the NAS so it always receives the same address - same effect as a static IP, managed in one place
  2. Use that address in the fstab line, as in the example panel: //192.168.1.50/FamilyDocs
  3. Write the address on the NAS's own label or in your notes - future you will thank present you
3

Step 3 - Quirk Two - the NAS Has Its Own Users

The account in your NAS credentials file is a NAS account, created in the NAS's own control panel - it has nothing to do with your Windows or Ubuntu users, even if you reuse a name.

  1. In the NAS panel (DSM on Synology, QTS on QNAP), create a user for this purpose and give it permission on the specific shared folder - read/write or read-only, deliberately
  2. Put that user name and password in /root/.nascredentials, locked with sudo chmod 600 /root/.nascredentials, exactly like the Windows file
  3. Permission denied from a NAS is fixed in its panel, not in Ubuntu: the shared-folder permission list for that user is the equivalent of the Windows two-locks check, on one screen
4

Step 4 - Quirk Three - the SMB Version Dial

Both ends negotiate an SMB version, and the NAS lets you set its range. Modern NAS firmware defaults to a sensible window (SMB2 and SMB3) and Ubuntu's default negotiation lands inside it - most people never touch this. It matters in two cases.

  1. If the NAS's minimum SMB version has been raised and the mount fails with a version error, you can pin the client side by adding vers=3.0 to the fstab options - or better, align the NAS range so default negotiation succeeds
  2. Truly old NAS boxes may speak only SMB1. Ubuntu's kernel can still be told vers=1.0, with warnings - but treat the need as information: SMB1 is obsolete and unsafe, so that box should be isolated or retired, not re-enabled across a network to satisfy it
  3. Never solve a version problem by lowering a modern NAS's security to SMB1. The setting to adjust is the range, on the NAS panel, staying at SMB2 or above
🔴 A slow first open is usually the NAS, not your mount. Most home NAS boxes spin their disks down when idle, and the first access after a quiet hour pays a few seconds of spin-up. If the folder reliably opens after that pause, the mount is healthy - the pause lives in the NAS's power settings, and it is saving your drives and electricity on purpose.

Watch the Complete Video Guide

Watch the video for the permanent mounting method in full - the same steps drive this NAS setup end to end.

Watch Full Video
Common Questions (FAQ)

The NAS name worked for weeks and then stopped resolving. Should I just use the IP?

Yes - that is the fix, not a fallback. Name discovery on home networks depends on several chatty protocols staying awake and agreeing, and it breaks for reasons that are hard to see. A reserved IP address in the fstab line removes that whole layer, which is why this page recommends it from the start.

Can I mount two different shares from the same NAS?

Yes - one fstab line per share, each with its own mount point. When both shares accept the same NAS account, both lines can point at the same credentials file, so a password change on the NAS means editing one file once. Different accounts simply get their own files.

Should a Linux machine use NFS instead of SMB for a NAS?

It is a fair option and worth an honest sentence: NAS boxes offer NFS, which is native to Linux and presents real ownership instead of invented uid and gid values. If every client of that share is Linux, NFS is cleaner. In a mixed office - Windows PCs and Ubuntu side by side on the same folders - one SMB share for everyone is usually the simpler, saner architecture.

This guide is based on the Technical Anshu video on mounting a Windows share in Ubuntu - stuck on any step, ask in the video comments and you will get an answer.