Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Set Up Shared Storage Between Ubuntu Servers With NFS

A complete Ubuntu guide to exporting /srv/shared with NFS, mounting it from another server, making the mount persistent, and troubleshooting permissions, versions, and security.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

NFS lets one Ubuntu server export a directory over the network while another Ubuntu server mounts that directory as if it were local storage. Install nfs-kernel-server on the exporting host, install nfs-common on each client, restrict access in /etc/exports, apply the export with exportfs, and add an /etc/fstab entry when the mount must survive reboots.

How an Ubuntu NFS share works

NFS uses a client-server model. The server owns the filesystem and publishes one or more directories, called exports. A client connects to an export and attaches it to a local directory, called the mount point. Applications on the client then use the mounted path through normal file operations.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This arrangement does not copy files between servers or create a second synchronized replica. Both machines access the same server-side data, so the server’s disks, filesystem permissions, availability, and network connection determine whether the client can use the share.

Roles and packages

Role Ubuntu package Purpose
NFS server nfs-kernel-server Runs the service that exports directories.
NFS client nfs-common Provides the mount helper and client utilities.

Use a supported Ubuntu release on both machines where possible. The two systems must be able to resolve or reach the server name and communicate on the ports required by the selected NFS version. Restrict the export to the smallest trusted client set; a broad network range is not a substitute for access control.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Configure the Ubuntu NFS server

1. Install and start the server service

  1. Refresh package metadata and install the server package:
    sudo apt update
    sudo apt install nfs-kernel-server
  2. Start the service immediately:
    sudo systemctl start nfs-kernel-server.service
  3. Check its state if the start command reports an error:
    sudo systemctl status nfs-kernel-server.service

Starting the service makes the NFS server available now. The export definition described below controls which directories and clients it will actually serve.

2. Create the directory to export

Create a dedicated directory rather than exporting the entire root filesystem or a user home directory unintentionally:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo mkdir -p /srv/shared

Choose ownership and mode bits that match the users or service accounts that will access the files. NFS normally evaluates numeric Unix user and group IDs, not the spelling of a username. If a user is ID 1001 on the client but ID 1001 belongs to someone else on the server, that user can receive unexpected access. For predictable multi-server permissions, keep relevant UID and GID assignments consistent or use a centralized identity system.

3. Add a controlled export rule

Edit /etc/exports as root and add a rule such as:

/srv/shared 192.168.10.0/24(rw,sync,no_subtree_check,root_squash)

The first field is the server directory. The second identifies permitted clients; this example allows hosts in the 192.168.10.0/24 subnet. Options inside parentheses determine write access, durability behavior, subtree checking, and treatment of client-side root.

Use a single host when only one client needs the share. For example:

/srv/shared 192.168.10.42(rw,sync,no_subtree_check,root_squash)

You can name a host if reliable name resolution is configured, but a name that resolves incorrectly can grant access to the wrong machine. Canonical’s Ubuntu guidance recommends making the client declaration as specific as possible so unwanted systems cannot access the mount.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Export options and when to use them

Decision Example Effect and trade-off
Read-only or read-write ro or rw ro prevents clients from changing exported data. Use rw only when clients must create, modify, or delete files.
Write durability sync or async sync commits changes before replying and favors consistency. async can improve performance but risks data loss or corruption if the server fails before buffered changes are committed.
Root mapping root_squash or no_root_squash root_squash maps client root to an unprivileged identity on the server. no_root_squash preserves client-root privileges and can let a client root user alter root-owned files, so reserve it for a documented administrative requirement.
Subtree validation subtree_check or no_subtree_check subtree_check verifies that requested paths remain inside the exported subtree. no_subtree_check avoids that check and can suit workloads with frequent file renames; select it with awareness of the different validation behavior.
Client scope Single IP, hostname, or CIDR Use the narrowest declaration that covers legitimate clients. Do not use a wildcard when a known host or small subnet is sufficient.

root_squash is the usual safe starting point. File access by ordinary users still depends on the server-side UID, GID, mode bits, and any ACLs on the directory.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

4. Apply and inspect the export

After saving /etc/exports, load the rules and display the active configuration:

sudo exportfs -a
sudo exportfs -v

exportfs -a applies additions, removals, and option changes. The verbose output lets you confirm that the expected directory, client range, and options are active before testing from another machine.

Prepare and test the Ubuntu client

1. Install the client utilities

sudo apt update
sudo apt install nfs-common

2. Create an empty mount point

sudo mkdir -p /mnt/shared

The mount-point directory must exist before mounting. Keep it empty: files already stored there become hidden while the NFS filesystem is mounted and reappear after unmounting. Using a dedicated empty directory prevents confusion and accidental writes to the local filesystem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Perform a live mount

Replace nfs-server with the server’s resolvable hostname or address:

sudo mount nfs-server:/srv/shared /mnt/shared

Confirm that the mount is present:

mount | grep /mnt/shared

Check both read and write behavior when the export is intended to be writable:

sudo sh -c 'printf "NFS testn" > /mnt/shared/nfs-test.txt'
cat /mnt/shared/nfs-test.txt
sudo rm /mnt/shared/nfs-test.txt

If the export is read-only, omit the write test and verify that reading an existing file works. A successful mount does not guarantee that every user can write; Unix ownership and permission checks still apply.

Unmount a temporary test

When the live test is complete, stop shells or applications whose current directory is under the mount and run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
sudo umount /mnt/shared

If the command says the target is busy, identify processes using the path, close those applications, and retry. Do not delete files from the mount point as a way to force an unmount.

Make the NFS mount persistent with /etc/fstab

A command-line mount lasts until unmounting or reboot. To have the client mount the export during normal startup, add this line to the client’s /etc/fstab:

nfs-server:/srv/shared /mnt/shared nfs defaults,_netdev 0 0

The four essential fields are the server and exported directory, the local mount point, the nfs filesystem type, and mount options. _netdev marks the filesystem as network-dependent so startup ordering can account for network availability. The final two zeroes disable the traditional dump backup flag and filesystem checks that are not appropriate for this network mount.

Validate the entry without rebooting

  1. Reload systemd’s generated mount units after editing fstab:
    sudo systemctl daemon-reload
  2. Mount the named path using the new entry:
    sudo mount /mnt/shared
  3. Verify the result:
    mount | grep /mnt/shared

If the mount command fails, read the error carefully and inspect service logs before rebooting. A typo in the server name, export path, or local directory is easier to correct while the machine is running than during an unattended boot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Optional availability behavior

For a client that must boot even when the NFS server is temporarily offline, discuss appropriate systemd and mount timeout behavior for your Ubuntu release before adding options such as nofail or automount settings. Those options change whether an unavailable share blocks startup and should be chosen for the role of that client, not copied blindly.

Resolve ownership, permissions, and root access

NFS does not bypass normal Unix permissions. On the server, inspect the exported directory and adjust its owner, group, and mode deliberately:

sudo chown -R shareduser:sharedgroup /srv/shared
sudo chmod 2770 /srv/shared

The exact account names and mode should reflect the workload. The set-group-ID bit in the example helps new files inherit the directory’s group, but it does not replace a correct group membership policy.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Why client root may not be able to write

With root_squash, UID 0 from the client is mapped to an unprivileged identity on the server. A root shell on the client therefore cannot automatically change root-owned files in the export. This limits the damage a compromised or misused client can cause.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Changing the option to no_root_squash makes administrative scripts that require root ownership easier, but it also allows client root to modify files that the server considers root-owned. Use it only when the trust boundary and operational need are explicit, and restrict the export to the smallest possible client set.

Keep IDs aligned

When several Ubuntu servers share files, compare the numeric output of id username on each host. Matching UID and GID values avoid a username on one server being treated as a different account on another. If IDs cannot be aligned, use an identity-management design that provides consistent mappings rather than relying on similarly spelled local accounts.

Choose authentication and transport protection

Local-network trust versus Kerberos

Basic NFS access commonly relies on the client identity presented by the Unix networking stack and is appropriate only when the surrounding network and hosts are trusted. For environments requiring stronger identity assurance, Ubuntu supports Kerberos security flavors:

Mount security flavor Provides Use when
sec=krb5 Kerberos authentication You need authenticated client and server identities.
sec=krb5i Authentication plus integrity protection You must detect tampering while data crosses the network.
sec=krb5p Authentication, integrity, and privacy File contents must be protected from network observers as well.

Kerberos requires a functioning realm, synchronized clocks, principals, and correctly configured client and server services. Add the chosen flavor to the export and client mount configuration only after that infrastructure is ready; otherwise the mount will fail even when the path and permissions are correct.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

RPC-with-TLS considerations

Current Debian exports(5) documentation describes RPC-with-TLS support through tlshd. Availability and configuration details can differ by Ubuntu release, so verify that the target release includes the required components and follow its release-specific procedure rather than assuming a Debian example is portable.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Select an NFS protocol version

The Ubuntu nfs(5) manual describes client support for NFS 3, 4.0, 4.1, and 4.2 when enabled by the kernel configuration. Start with the distribution default, which is normally the best interoperability choice.

Pin a version only when a peer requires it or when troubleshooting a negotiation problem. For example, a temporary test can request NFS version 4:

sudo mount -t nfs -o vers=4 nfs-server:/srv/shared /mnt/shared

The equivalent persistent option is:

nfs-server:/srv/shared /mnt/shared nfs defaults,_netdev,vers=4 0 0

Do not assume that changing vers fixes every failure: export paths, firewall rules, name resolution, authentication flavor, and permissions can independently prevent a mount.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Patterns for more than one client

One export for a controlled subnet

A CIDR declaration is practical when every host in a small, trusted network segment needs identical access:

/srv/shared 192.168.10.0/24(ro,sync,root_squash)

This is suitable for common read-only content. It grants access to every address in that range, so keep the subnet limited and avoid placing untrusted devices in it.

Different policies for different clients

When one client needs writing and others need only reading, create separate client declarations with the intended policy and verify the resulting export table. For example:

/srv/shared 192.168.10.42(rw,sync,root_squash)
/srv/shared 192.168.10.43(ro,sync,root_squash)

Keep rules unambiguous and inspect them with sudo exportfs -v. A client should never receive broader access merely because it happens to be on a subnet that also contains a trusted writer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot common failures

Symptom Likely cause Checks and corrective action
mount.nfs: No such file or directory Wrong exported path or a missing local mount point. Confirm the server path in /etc/exports, run sudo exportfs -v on the server, and create the client directory with sudo mkdir -p.
Permission denied Client is outside the allowed declaration, export is ro, or Unix IDs and mode bits do not permit the operation. Check the client address, export options, server ownership, and the numeric output of id.
Mount hangs or times out Name resolution, network filtering, service state, or protocol negotiation problem. Resolve the server name, test reachability, inspect systemctl status nfs-kernel-server.service, and try the distro default version before pinning vers=.
Changes to /etc/exports have no effect The edited file was not reloaded. Run sudo exportfs -a, then inspect sudo exportfs -v.
Files in the mount directory seem to vanish The NFS filesystem is hiding pre-existing local files. Unmount the share to reveal them; use a dedicated empty mount point to avoid this ambiguity.
Boot pauses because the share is unavailable The persistent mount requires a server that is offline or not yet reachable. Confirm _netdev, review whether availability options such as nofail fit the client, and correct the server or network problem.
Stale file handle after server-side changes A file or directory was replaced while a client held an old NFS reference. Close applications using the path, unmount and remount the share, and avoid renaming or replacing active directory trees during maintenance.

Change or remove an export safely

Before changing a live export, identify clients that depend on it and schedule the change if applications are writing. Edit /etc/exports, apply the new rules with sudo exportfs -a, and verify the result. To remove a specific active export immediately, use the corresponding exportfs -u form, then remove or update its line in /etc/exports so it does not return after a reload.

On a client, stop processes using the share and run sudo umount /mnt/shared. If the path is listed in fstab, remove or comment out that line before decommissioning the server; otherwise the client will continue trying to mount a nonexistent export at startup.

Deployment checklist

  • Install nfs-kernel-server only on the exporting host and nfs-common on each client.
  • Create a dedicated export directory and set deliberate server-side ownership and permissions.
  • Use a specific host or smallest necessary CIDR range in /etc/exports.
  • Select ro or rw according to the workload, not convenience.
  • Keep root_squash unless a documented requirement justifies another mapping.
  • Prefer sync when durability matters; accept the risk before choosing async.
  • Run exportfs -a and inspect exportfs -v after every export change.
  • Test a live mount at an empty client directory before editing fstab.
  • Add the persistent line with _netdev, run systemctl daemon-reload, and mount it manually before rebooting.
  • Use Kerberos flavors when network-level identity, integrity, or privacy requirements exceed local-network trust.
  • Leave NFS version negotiation at the Ubuntu default unless interoperability or troubleshooting requires an explicit vers= value.

With those controls in place, NFS provides a straightforward shared filesystem between Ubuntu servers while keeping the export boundary, write capability, root privileges, durability, and authentication choices explicit.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.