- Integrated Systems
- About Us
- Integrated Systems
- About Us
08-06-2009 01:46 AM
I need to export a file system in a Linux box and mount it with read annd write permission in 4 other Linux Web Servers but i don´t know if this can be done and what would happen in case 2 machines tried to access and write into the File System at the same time, how NFS would manage this situation?
Solved! Go to Solution.
08-06-2009 02:39 AMSolution
Here is a sample /etc/exports file.
There are other options such as host name limitations.
# Limits exported directory access to host name bob.example.com
In the example, bob.example.com can mount /exported/directory/. Because no options are specified in this example, the following default NFS options take effect:
ro â Mounts of the exported file system are read-only. Remote hosts are not able to make changes to the data shared on the file system. To allow hosts to make changes to the file system, the read/write (rw) option must be specified.
wdelay â Causes the NFS server to delay writing to the disk if it suspects another write request is imminent. This can improve performance by reducing the number of times the disk must be accessed by separate write commands, reducing write overhead. The no_wdelay option turns off this feature, but is only available when using the sync option.
root_squash â Prevents root users connected remotely from having root privileges and assigns them the user ID for the user nfsnobody. This effectively "squashes" the power of the remote root user to the lowest local user, preventing unauthorized alteration of files on the remote server. Alternatively, the no_root_squash option turns off root squashing. To squash every remote user, including root, use the all_squash option. To specify the user and group IDs to use with remote users from a particular host, use the anonuid and anongid options, respectively. In this case, a special user account can be created for remote NFS users to share and specify (anonuid=
Owner of ISN Corporation
08-06-2009 03:27 AM
Re: export NFS File System
NFS versions 2 and 3 will require you to run separate RPC lockd and statd services on both server and the clients to allow file locking. The locks in these NFS versions are advisory only. In general, file locking has been something of a weak point of NFSv2 and NFSv3. Only some file locking functions of the OS are supported by NFS, so the application must explicitly be programmed to expect that someone else may be accessing the files, and to use NFS-compatible file locking functions (fcntl() instead of flock()).
NFS version 4 allows mandatory locking, but it's significantly newer and less well known than the older versions. The application still must not assume it's the only one accessing its files, and it must request the correct types of locks based on what it is going to do.
NFSv4 also has more complex security features than the older versions of the protocol. Make sure you understand your NFSv4 configuration and test it carefully before using it in production systems.