linux poison RSS
linux poison Email

NFS configuration for central storage

Configuring The NFS Server
1. Edit the /etc/exports file to allow NFS mounts of the /home directory with read/write access.

/home                   *(rw,sync,no_subtree_check)

The option listing for each machine will describe what kind of access that machine will have. Important options are:

ro: The directory is shared read only; the client machine will not be able to write to it. This is the default.

rw: The client machine will have read and write access to the directory.

no_root_squash: By default, any file request made by user root on the client machine is treated as if it is made by user nobody on the server. (Excatly which UID the request is mapped to depends on the UID of user "nobody" on the server, not the client.) If no_root_squash is selected, then root on the client machine will have the same level of access to the files on the system as root on the server. This can have serious security implications, although it may be necessary if you want to perform any administrative work on the client machine that involves the exported directories. You should not specify this option without a good reason.

no_subtree_check: If only part of a volume is exported, a routine called subtree checking verifies that a file that is requested from the client is in the appropriate part of the volume. If the entire volume is exported, disabling this check will speed up transfers.

sync: By default the exportfs command will use async behavior, telling a client machine that a file write is complete - that is, has been written to stable storage - when NFS has finished handing the write over to the filesysytem. This behavior may cause data corruption if the server reboots, and the sync option prevents this.

2. Let NFS read and make /home available to the network with the exportfs command.

# exportfs -a

3. Make sure the required nfs, nfslock, and portmap daemons are running and configured to start after the next reboot.

# chkconfig nfslock on
# chkconfig nfs on
# chkconfig portmap on

# service portmap start
# service nfslock start
# service nfs start

Configuring The NFS Client
1. Make sure the required netfs, nfslock, and portmap daemons are running and configured to start after the next reboot.

# chkconfig nfslock on
# chkconfig netfs on
# chkconfig portmap on

# service portmap start
# service netfs start
# service nfslock start

2) Now mount the NFS (server) /home to this client

# mount server:/home /home/

3) Configure autofs edit your /etc/auto.master file to refer to file /etc/auto.home for mounting information whenever the /home directory is accessed. After five minutes, autofs unmounts the directory.

# vi /etc/auto.master
/home      /etc/auto.home --timeout 600

4) Edit file /etc/auto.home to do the NFS mount whenever the /home directory is accessed.

# vi /etc/auto.home
*   -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid,tcp server:/home/&


0 comments:

Post a Comment

Related Posts with Thumbnails