Wednesday, September 23, 2015

Setting up NFS on openSuse

Something I've wanted to do for a long time is set up a network file share (NFS). And with the discovery that the /home partition on my old development box is rapidly filling up, it seemed like a good time to do it. That way, I can transfer some of the less server-centric stuff to my laptop, on which I'm doing more general-purpose computing, development, etc.

I'm not actually sitting at the box where I configured the server and made notes of this process. But it went something like the following.

The first order of business is to make the server filesystem available on my laptop, which also runs openSuse. It turns out that there is a package, nfs-server, implemented as a kernel module, which provides the service. It's not installed by default, so I head over to the package management tool, YaST, and install it.

No dependencies. Bada bing, bada boom.

I decide to see if I can get it running. In the System Services panel, it's now there as nfs-server. It's disabled (won't start automatically) and not running. I click "start/stop". Clicking on the "Details" button opens a dialog with a complaint about not being able to bind to a port, as it's already taken (by another service). Hmm. What service? Why wouldn't it choose an available port? In an intuitive stroke of genius, I start the rcp-bind service, which I read somewhere is needed by NFS. The service now starts. Beginner's luck takes the day. You gotta love this stuff.

On the client machine (laptop), I open the NFS client panel in YaST system services. There's a couple of text fields, server domain and filesystem path. Hoping for the best, I just click "Choose". A pop-up informs me that it's scanning the local network for a NFS service. It fails to find one.

A Google search turns up some good documentation at https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/s2-nfs-nfs-firewall-config.html
There's a command "showmount" that may help. I enter the following in the root terminal window:

$> showmount -e 10.0.0.7

And what do you know? It reports the following:

Export list for 10.0.0.7: /multimedia/music

As this is the directory I had specified in the server config file (etc/exports), I know it speaks sooth. Amazing? How was it able to find the service while the YaST NFS Client tool was unable to even when pointing it at the server box? I mess around with it some more but nothing can make it find the service.

But now life is good. The laptop found the service.

Next, mounting the filesystem on the client provided another challenge. I'm not sure exactly what solved it. It was one of the following: actually mounting the server filesystem to be exported (for some odd reason), or adding "fsid=0" to the entry in /etc/exports. The "fsid=0" issue is discussed at http://forums.fedoraforum.org/showthread.php?t=164662 .

At the end of the day, it works. And it appears to be maintainable. Even after a server restart, the service is available on the client.

No comments:

Post a Comment