Debian 6.0
Sponsored Link

NFS Server2011/03/07

  Build NFS Server to share any directories.

[1] Configuration on the system you want to build NFS server
root@master:~#
aptitude -y install nfs-kernel-server portmap


root@master:~#
vi /etc/exports


# write like below *note

/home 10.0.0.0/24(rw,sync,no_root_squash,no_subtree_check)


# *note
/home
⇒ shared directory

10.0.0.0/24
⇒ range of networks NFS permits accesses

rw
⇒ possible to read and write

sync
⇒ synchronize

no_root_squash
⇒ enable root privilege

no_subtree_check
⇒ disable subtree check


root@master:~#
service portmap restart

Stopping portmap daemon....
Starting portmap daemon....
root@master:~#
/etc/init.d/nfs-kernel-server restart

Stopping NFS kernel daemon: mountd nfsd.
Unexporting directories for NFS kernel daemon....
Exporting directories for NFS kernel daemon....
Starting NFS kernel daemon: nfsd mountd.
[2] Configuration on NFS clients
root@www:~#
aptitude -y install nfs-common portmap


root@www:~#
mount -t nfs master.srv.world:/home /home

root@www:~#
df -h

Filesystem
Size
Used
Avail
Use%
Mounted on

/dev/mapper/www-root
19G
611M
18G
4%
/

tmpfs
502M
0
502M
0%
/dev

udev
497M
96K
497M
1%
/dev/shm

tmpfs
502M
0
502M
0%
/var/run

/dev/vda1
236M
22M
202M
10%
/boot

master.srv.world:/home
19G
611M
18G
4%
/home

# home directory on NFS is mounted


root@www:~#
vi /etc/fstab


# add at the last: change home directory this server mounts to the one on NFS

master.srv.world:/home   /home   nfs   defaults   0 1
Matched Content