NFS Server2012/05/07 |
Configure NFS Server to share any directories in local network.
|
|
[1] | Configuration on the system you want to build NFS server |
root@dlp:~#
aptitude -y install nfs-kernel-server
root@dlp:~#
vi /etc/exports # write like below *note /home 10.0.0.0/24(rw,sync,fsid=0,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
/etc/init.d/nfs-kernel-server restart * Stopping NFS kernel daemon ...done. * Unexporting directories for NFS kernel daemon... ...done. * Exporting directories for NFS kernel daemon... ...done. * Starting NFS kernel daemon ...done. |
[2] | Configuration on NFS clients |
root@www:~#
root@www:~# aptitude -y install nfs-common mount -t nfs dlp.srv.world:/home /home root@www:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/ubuntu-root 18G 1.3G 16G 8% / udev 993M 4.0K 993M 1% /dev tmpfs 401M 228K 401M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1002M 0 1002M 0% /run/shm /dev/vda1 228M 25M 192M 12% /boot dlp.srv.world:/home 18G 1.3G 16G 8% /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 dlp.srv.world:/home /home nfs defaults 0 0 |