Setting up an NFS server with YAST

As I am upgrading to a completely new machine I thought that I would set the old one up as an NFS server and the new one as a client to transfer files. Seems easy to do with YAST apart from one area.

Hosts Wild Card. This defaults to a single * but am not sure if this restricts access to the local network. Also it seems an ip addresses can be use to achieve this but not sure about the syntax.

Actually there is another as well. Exporting the directory. In this case it is my old home directory and all sub folders.

Machines on my network use the router assigned addresses so aren’t static looking briefly YAST’s client set up it searches for servers so that aspect shouldn’t matter?

Can anyone help?

John

The Yast module is a GUI interface for configuring /etc/exports. Thus

man exports

will tel you everything that can be configurd there. Then either use YaST to configure (and check the contents of /etc/exports to see if it is what you wanted) or edit /etc/exports directly.

An example that may help you is my configuration:

boven:~ # cat /etc/exports
/home/wij       b*.henm.xs4all.nl(rw,sync,no_subtree_check)
boven:~ #

And it means that the directory /home/wij is exported to be accessed only by systems within domain henm.xs4all.nl (my local domain, not registered in Internet DNS) and where the hostname starts with the character b. This may be a bit strange restriction, but it shows what can be done. In your case using an IP network might be more appropriate (like 10.0.0.0/24)

Thanks

:\This touches one where I find “help” difficult. I can cope with ip masks the few times I use them if I refresh my memory but what is the 10.0.0.0/24. The /24 syntax rings no bells and leaves me wondering if the 10.0.0.0 is a mask or specific ip address. Maybe the 24 is a port in which case I assume this matches the one opened in the firewall.

In my case, need to check, the local net is on 193.168.10.??? from memory. Set up 4 or 5 years ago.

lol! You wouldn’t believe I have run 2 networks in the past. Trouble is things change. Finish being very aware of what is going on but no idea how to do it and it’s the basics that cause problems.

John

In your case the notation would be 193.168.10.0/24 or 193.168.10.0/255.255.255.0 as both notations are allowed in this /etc/exports case (though not in every tool/configuration file you may find).
Both mean that the first 24 bits of the IP address are the network part and thus the last eight bits are the host part.

And of course you shouldn’t work from memory (except when it is flawless), you must be sure. But you could check by checking what the IP address and netmask of the several systems in your network are:

/sbin/ifconfig -a

BTW that will reveal you what is the network part of the addresses in your LAN. This mght be different from what you want to configure in /etc/exports. But I guess you only have this one LAN and want to allow all systems in that LAN to mount from that NFS server.

Thanks that should do me. I see that the /24 is a bit count from msb. A new method for me. I suspect I will use the mask.

I do wish the docs people would expand a little more on basics like this. It must be awful for some one who hasn’t any idea what should be available when setting things like this up.

John

On 2013-07-06 00:06, John 82 wrote:
>
> As I am upgrading to a completely new machine I thought that I would set
> the old one up as an NFS server and the new one as a client to transfer
> files. Seems easy to do with YAST apart from one area.

If you need to transfer files just this time, just open a terminal, run
“mc”, and on the left or right panel use the “shell link” option. It
just uses ssh to create a virtual filesystem of the remote machine,
which you can use to copy files in any direction.

>
> Hosts Wild Card. This defaults to a single * but am not sure if this
> restricts access to the local network. Also it seems an ip addresses can
> be use to achieve this but not sure about the syntax.

One example:


> /data/other/   192.168.1.0/24(fsid=1235,ro,root_squash,nohide,no_subtree_check)

> Machines on my network use the router assigned addresses so aren’t
> static looking briefly YAST’s client set up it searches for servers so
> that aspect shouldn’t matter?

Actually, it does matter. You normally create a line in fstab on the
client to connect to the server machine having nfs. If on the next boot
the “server” is on another machine, the client will hang on boot.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

On 2013-07-06 10:56, hcvv wrote:
> And it means that the directory /home/wij is exported to be accessed
> only by systems within domain henm.xs4all.nl (my local domain, not
> registered in Internet DNS)

Just a comment. Using a domain with a suffix that does exist causes a
DNS query on internet asking who is “henm.xs4all.nl”. It will say that
it doesn’t exist (actually, it does exist, it is 80.101.225.164), but
that takes some time. It is better to use a suffix that does not exist;
I use “lnet”. A common one is “.local”, but this interferes with samba
(avahi, actually).


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Well, IP addresses and netmasks to make a difference between the network part and host part of an IP address, etc. is indeed rather basic.A but not typicaly for openSUSE or even Linux. I guess basic information about this and other network aspects are to be found easily on the Internet. A very logical start for me would be to go to Wikipedia: IP address - Wikipedia, the free encyclopedia

In this case it’s a one off connection so providing it connects when I enable the client software in the new machine nothing else matters really. Once the files are transferred the old one goes into the cupboard in case I’m stuck for a spare sometime. I’m also interested in how well NFS performs. I use CIFS directly with my nas which does have a static IP address, Nothing in fstab though as I mount it when I want to use it. It seems it may now be possible to use NFS easily with the more recent versions of windows so as my son for instance will only use windows NFS may be an option now but I suspect CIFS is more secure in the limiting access area.

HOWTO: Mount NFS shares under Windows 7 | Sage Hacks

John

Setting up the server went without any problems.

The client end wasn’t so much fun. YAST seems to scan for an NFS server and as it points out this is probably blocked by the firewall. I also tried setting up a local server DNS service for it in the router but access by name still wouldn’t work.

If the IP address is entered into the server name space in the client set up and then choose directories selected it connects and displays all of the directories from the directory set in the server. It’s best to create a folder to link too before setting up the client. If this is created in the client set up it will have root ownership - not much use if someone wants to access as an ordinary user.

I streamed a lowish res video across the link to VLC to check if it was working. Fine once a buffer had been built up.

I then went on to import my email into the new machine. :’( Immediate error as soon as I navigated into .kde4-Can’t access directory. Any thoughts?

John

On 2013-07-13 00:36, John 82 wrote:
>
> Setting up the server went without any problems.
>
> The client end wasn’t so much fun. YAST seems to scan for an NFS server
> and as it points out this is probably blocked by the firewall. I also
> tried setting up a local server DNS service for it in the router but
> access by name still wouldn’t work.

If it does not work by IP, DNS will not help.

> If the IP address is entered into the server name space in the client
> set up and then choose directories selected it connects and displays all
> of the directories from the directory set in the server. It’s best to
> create a folder to link too before setting up the client. If this is
> created in the client set up it will have root ownership - not much use
> if someone wants to access as an ordinary user.

No, NFS has the same ownership in the server as in the client.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Might be some misunderstanding Carlos. The client setup has the facility to navigate to the folder that will be linked to the folder exported by the server. It also has the ability to create a new directory. As YAST is running as root the folder will only have root permissions. Pretty obvious really but I did it that way without thinking.

The problems remind me of the ones when I set my nas up in certain ways. Some applications would work with it and some wouldn’t. In this case I suspect it may be down to the install and when I look I may find my user id number is different to the 11.4 install. This goes back to some advice I received some time ago. When upgrading keep both the password and the user name the same - relating to transferring files to a new machine. It’s worked in the past and I think I have briefly noticed a differing user id numbers on them this time. Suppose I could create another user same name different ID number on the old machine but am fed up with swapping the monitor between machines.

The reason I think it’s down to user id numbers is that I have transferred some files via a disc and had to change the rights on them before I could transfer them and the directory structure to the new machine. Done via a USB sata hub at 25mB/sec which took a long time both to write to the disc and then write to the new machine. The ownership change took a long time too. Hence NFS where I should be able to approach 40 or more mB/sec and only write the files once.

:sarcastic: Anyway if some one wants to do it this way in the future as it does make sense to do it this way hopefully if they look after the user id aspect all will be ok.

As it stands going on comments on the kde mailing list people may have problems after transferring their mail anyway. I suspect this is down to transferring directories to more recent software and the dreaded indexing thingy getting messed up. Mail import should be ok as should address book import but account and identity info etc probably needs entering again by hand now. Before it was just a case of copying the correct directories across. A fair few have transferred to claws mail on the list now even going as far as compiling the indexing thingy out of kde.

>:( Yes I am especially after Kmail’s import facilities only appeared very shortly after I made some very pointed comments on the mailing list a log long time ago on 3 point something low. They are still very unprofessional and should be capable of importing everything in one go.

John

On 2013-07-13 12:46, John 82 wrote:
>
> Might be some misunderstanding Carlos. The client setup has the facility
> to navigate to the folder that will be linked to the folder exported by
> the server. It also has the ability to create a new directory. As YAST
> is running as root the folder will only have root permissions. Pretty
> obvious really but I did it that way without thinking.

Nonono. Not true.

The folder, regardless of how you created it, is just a Linux folder and
you can apply to it whatever permissions you choose and prefer. In the
server, of course, not remotely from the client (for the master directory).

Mind: NFS looks at the UID numbers, not at the names. So if “john” is
1000 in server and 1003 in client, you are in trouble.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

:wink: Folder on new pc called OldPC. OldPC being created in YAST while setting up the client. OldPC had root only set. Deleted it with Dolphin SU mode and recreated it as a normal user. I could enter it then.

Trouble on user id’s yes. For some reason using the same user name and password has resulted in a different user id number on each machine. Keeping this the same came from KDE people though and concerned transferring files and may have nothing to do with user id’s. Always worked in the past. I also always set up users the same way as well. Decline the rootish aspects of the install and just set myself as a normal user and then provide a root password. Also no boot straight through.

At least the posts are of some use if some one else wants to do this. I could create another user on the old machine, same name and same user id number as on the new machine and right click directories that are to be transferred and set user rather than specific user access. That along with the server set up noting the IP address means there is no need to go near the old machine again other than maybe to put things back as they were.

Also meant to mention that when the client connection is deleted in YAST it also correctly removed the fstab entry for it.

John

On 2013-07-13 17:26, John 82 wrote:
>
> :wink: Folder on new pc called OldPC. OldPC being created in YAST while
> setting up the client. OldPC had root only set. Deleted it with Dolphin
> SU mode and recreated it as a normal user. I could enter it then.
>
> Trouble on user id’s yes. For some reason using the same user name and
> password has resulted in a different user id number on each machine.

The UIDs are just numbers. The first user you create gets the number
1000, the next is 1001, the next 1002… etc.

If the server machine the user of interest is 1008, just create a user
in the client that has the same number: you can edit the number before
the user is created (and after, going through some hassles).


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)