NFS is a Network File System, it was developed by SUN Microsystems and enable the access to files in a network infrastructure. You can get a deeper knowledge about NFS in here. In order to operate a NFS server on the IPFire, the nfs package needs to be installed.
NFS can be installed as an IPFire addon over the console with:
pakfire install nfs
or over the IPFire web interface via Pakfire
After the successful installation of both Addons they are to be seen in the right selection field on the Pakfire page in the Webinterface.
A finished export-file looks in approximately like this:
/mnt/harddisk/Daten 192.168.0.0/24(rw,async,subtree_check, no_root_squash,anonuid=99,anongid=99)
In the example the following options were set:
|/mnt/harddisk/Data||The directory on the IPFire where the data to be stored|
|192.168.0.0/24||The IP or the network, which may access the NFS server (all PC´s with the IP range from 192.168.x.x are permitted|
|rw||Enable read and write access|
|async||Allow the server to cache the data and to write it only if the opportunity is in addition|
|subtree_check||This option proofs that the data will be written in the correct subdirectory|
|no_root_squash||The anonymous user/GruppenID|
|anonuid=99,anongid=99||Here are the user and the group ID, who have accessed to the NFS server. (99 is nobody, 0 is root)|
Note:More information about the NFS options can be found in here.
If the file is processed and stored, the NFS server must be reloaded now, this occurs with the command line:
If not everything are returned here with OK , some options are falsely set or not available .
The following steps on Client side leads now to the target:
Under Linux the slogan takes affect “all is a file”. These following the released folder on the server is also a file or a directory. We create this new file under the directory “/media”. Thus a file on the Client exists, which refers in reality to the server (and nobody will notice it).
sudo mkdir /media/server
creates the file. In place of “server” you take any name which you prefer. This file belonged however to the user root and as normal user you do not have access on it. To change this two command lines are necessary:
sudo chmod user /media/server sudo chgrp user /media/server
Now the file belongs to the user (your user name) and the user can access it. However it is missing still another little thing, cause the reference, that this file is to refer its contents from the server.
We divide the client now where the server is. You need to enter the following line into the file “/etc/fstab” additionally:
192.168.0.1:/home/user/shared /media/server nfs rw,rsize=8192,wsize=8192 0 0
The file “/etc/fstab” is a list of all volumes which according to standard accesses. Here you should find the record from all your volumes.
sudo mount -a
This mounts the remote shared resource into the local file system on “/media/server”. The storage space on the remote server should be available to you and you should be able to place files into the folder as well. Have fun!
If IPFire should act as a client, the record in “/etc/fstab” is not enough to mount the network drive automatically during the boot process. A workaround is to insert the line below into the file “/etc/sysconfig/rc.local”
mount -a -t nfs
To release portmap on the blue network segment, a record must take place in the file hosts.allow. The record:
…. will need these lines created (add them)
sshd : ALL ALL : localhost ALL : 192.168.0.0/255.255.255.0