116
•
Step-by-Step Guide to your own Linux Application
NFS
Server
Setup
WAGO-I/O-SYSTEM
750
Linux Fieldbus Coupler
5.11 NFS Server Setup
NFS (Network File System) allows access to files across the networks as if
they were local files. This service is available under both Linux and Unix.
The local
/targetfs
directory serves as output directory for the application
creation. It can be linked to the Linux coupler file system via NFS.
To enable NFS support, add the following line to the file
/etc/exports
:
/targetfs *(rw,sync,all_squash,anonuid=<uid>,anongid=<gid>)
The Linux user ID/group ID must be entered as UID and GID. One way to
determine the number is
> id
uid=501(u04711) gid=100(users) Gruppen=100(users),14(uucp)...
which results in:
/targetfs *(rw,sync,all_squash,anonuid=501,anongid=100)
Linux coupler NFS client configuration
NFS is integrated into the Linux kernel and is used as a file system. In order to
link a directory of a remote system it has to be assigned to the Linux directory
structure using the mount call, just like a partition on the hard drive.
In order to be able to use the NFS service, a NFS server and an enabled
directoty must be available on the remote PC. The remote directory is linked
to the Linux fieldbus coupler file system by the call
mount -t nfs -o nolock <IP/hostname>:/<Directory>
/<local directory>
Example:
>
mount –t nfs –o nolock 192.168.1.12:/targetfs /nfs
To serve this purpose, the Linux coupler provides the
/nfs
drive (delivery
status). The drive can be accessed like a local drive. If drives are to be linked
automatically during system start-up, they must be entered in the
/etc/rc
file.