2022-03-10 00:00:00

Technologyclient-server|disk sharing|file sharing|LAN|linux

How to set up disk sharing for Linux computers with NFS

If your home or office is powered by Linux computers, you may want to have a system for sharing files. Our small office has been using file sharing software called NFS (Network File System) for quite some time now, and we are pretty happy with it. Here is a brief how-to guide for setting up NFS file sharing for Linux computers.

NFS was developed by Sun Microsystems for the Solaris product range that was built on Unix. NFS has been around for a long time, and it is considered a solid file sharing software for Linux and Unix operating systems. As time has passed, however, NFS Windows software hasn't kept up with. NFS is designed to provide disk sharing on a LAN (Local Area Network). It is not a cloud service that can be accessed from anywhere with any device.

If you are familiar with the native file sharing functionality in Windows or in Mac, NFS is similar with them. Other disk sharing choices for Linux are Samba and sshfs (command line file access that uses ssh).

NFS is a client-server system. You designate one or more computers as the server, and the others are clients. The server shares a specified disk to clients that can read from and write to (depending on the configuration) the shared disk. The server and clients must be connected to the same LAN.

Installing NFS

In our small office, Linux computers run Debian or a distribution built on Debian, like Ubuntu, and that is the environment where the following instructions have been tested.

Install the NFS server software

The computer that shares its disk requires the server module of NFS. In systems that have apt packaging, the command to install is:

apt-get install nfs-kernel-server

After the software has been installed, you have to tell NFS which disk you want to share. The configuration file's name is: /etc/exports

The file features examples how to specify the disk to be shared. You can use the hostname of the server computer or its IP address in the LAN to specify the shared disk. For instance (edit names to match your system):

/media/username/SSD1TB/docs blackberry(rw,sync,no_subtree_check)
or
/media/username/SSD1TB/docs 192.168.10.0/24(rw,sync,no_subtree_check)

Run the command below to tell the NFS server about the new disk share:

exportfs -ra

You can verify that NFS server understood what you wanted to say:

exportfs -s

Install the NFS client

Computers that access the shared disk need a client software that is installed like this:

apt-get install nfs-common

Once the client has been installed, you can mount the shared disk specified on the server as a local disk for the client (here, /media/username/nfsshare is the local name the client accesses). You may have to create the mountpoint directory first (in this case: mkdir /media/username/nfsshare), and then run:

mount -v -t nfs blackberry:/media/username/SSD1TB/docs  /media/username/nfsshare/

If it doesn't work but throws error messages like:

mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting

Try and specify the NFS version for the mount command:

mount -v -t nfs -o nfsvers=3 blackberry:/media/username/SSD1TB/backup /media/username/nfsshare/

Troubleshooting

If your NFS client was able access a shared NFS disk but the connection hangs up (in the worst case, your computer freezes), it may mean that the connection has broken down or the server has been shut down. Try to force disconnect from the NFS server:

umount -f /media/username/nfsshare
or
umount -l /media/username/nfsshare

You can display the mounted disks on the client:

df -h

On the server, check the status of the NFS server:

systemctl status nfs-server

And restart NFS server if needed:

systemctl restart nfs-server

Also on the server, verify what is shared:

showmount -e hostname (or ip address instead of the hostname)

This article has more tips for troubleshooting.

NFS on Windows

NFS client applications such as FreeNFS and NFSClient are available for Windows PCs, but getting them to run on recent versions of Windows seems to be tricky. We only tried them briefly and didn't succeed, but if someone has managed to get them to work, please share your tips.

News

2025-06-11 16:24:00

Let's go.#streetphotographyflic.kr/p/2r3EuJNhttps://flic.kr/p/2r3EuJN


News

2025-06-04 18:08:00

A #photographer has been using sunglasses with a camera and loudspeakers for 8 months: "I quite enjoy them, and they’ve quickly become my daily wear as far as sunglasses are concerned."https://fstoppers.com/artificial-intelligence/ray-ban-meta-glasses-photographers-perspective-701899


News

2025-06-02 14:42:00

Today, digital nomads recognize the benefits but also risks of their lifestyle. An extensive study among traveling workers reveals the highs and lows of the nomad life. #remotework #digitalnomadhttps://klaava.com/digital-nomads-feel-powered-by-their-lifestyle-but-recognise-inevitable-downsides-as-well/


Aland archipelago

2025-05-30 16:59:41

Aland archipelago


Highway across a swamp.

2025-05-30 11:14:51

arihak

Highway across a swamp.


News

2025-05-26 16:29:00

Flower market, but she is selling fruit trees.#streetphotographyhttps://unsplash.com/photos/TfQ6uYmI9QQ


News

2025-05-22 14:19:00

In Spain, the Balearic government asked influencers to help ease pressure on overcrowded hotspots by promoting less-visited areas. Instead, influencers have unintentionally drawn large crowds of tourists to remote, ecologically sensitive locations. #photography #selfiehttps://petapixel.com/2025/05/21/spanish-islands-ban-influencers-after-4000-tourists-flock-to-tiny-beach-for-selfies/


News

2025-05-18 18:23:00

Most travelers already knew that south Europe is the warm and sunny zone of #Europe, and this ranking confirms it. Spain and Italy have most cities in the top 30, followed by France and Portugal. #travelhttps://klaava.com/sunniest-cities-in-europe/


Popular sight in Sevilla

2025-05-16 17:51:34

Popular sight in Sevilla


News

2025-05-14 16:03:00

Bordeaux is ready for hot summer days.#streetphotographyhttps://pixelfed.social/p/arihak/827854641319295061


Cooling zone.

2025-05-13 12:38:47

arihak

Cooling zone.


Hochosterwitz castle

2025-05-10 15:23:05

Hochosterwitz castle


News

2025-05-07 14:39:00

A meeting in winter sun.#streetphotography #travelphotographyflic.kr/p/2qey2NHhttps://flic.kr/p/2qey2NH


News

2025-04-30 17:01:00

Shady character.#streetphotography #travelphotography #StreetPhotography


Not in space, but firmly on the ground in Valencia.

2025-04-25 17:47:30

arihak

Not in space, but firmly on the ground in Valencia.


News

2025-04-24 15:17:00

According to a survey, football (a sport where you are supposed to kick the ball instead touching the ball with a hand) is the most popular sports that fans want to follow live on site even if it means traveling overseas. #travelhttps://klaava.com/sports-events-are-trending-among-travelers/


News

2025-04-23 14:19:00

An unexpected recognition for analog #photography : UNESCO Cultural Heritage designation suggests a renewed appreciation for the craftsmanship and cultural significance of analog methods.https://www.diyphotography.net/analog-photography-recognized-as-intangible-cultural-heritage-by-unesco/


News

2025-04-17 13:18:00

New restriction on Flickr #photo sharing: Free #Flickr accounts will be restricted from downloading original and large-size images. While users will still be able to upload photos of all sizes, free account holders will only be able to download medium and small photos.https://petapixel.com/2025/04/16/flickr-restricting-download-sizes-for-free-accounts/


News

2025-04-16 10:54:00

Morning commute.#streetphotography#travelphotography


News

2025-04-12 09:17:00

The region in #Europe where you will get more #travel days for your euro (or whatever the local currency happens to be). The difference in the average cost is vast between the cheapest and the most expensive European countries.https://klaava.com/here-are-the-cheapest-countries-to-travel-in-europe/