Ubuntu 10.04
Sponsored Link

NFS Server
2010/07/21
  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
⇒ enable users' authority


root@master:~#
service portmap restart

portmap start/running, process 2256
root@master:~#
/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.
root@master:~#
update-rc.d portmap defaults 19

update-rc.d: warning: /etc/init.d/portmap missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
# it's no ploblem above. it may be bugs

  Adding system startup for /etc/init.d/portmap ...
/etc/rc0.d/K19portmap -> ../init.d/portmap

/etc/rc1.d/K19portmap -> ../init.d/portmap

/etc/rc6.d/K19portmap -> ../init.d/portmap

/etc/rc2.d/S19portmap -> ../init.d/portmap

/etc/rc3.d/S19portmap -> ../init.d/portmap

/etc/rc4.d/S19portmap -> ../init.d/portmap

/etc/rc5.d/S19portmap -> ../init.d/portmap

[2] Configuration on NFS clients
root@www05:~#
aptitude -y install nfs-common portmap


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

root@www05:~#
df -h

Filesystem
Size
Used
Avail
Use%
Mounted on

/dev/mapper/www05-root
19G
869M
17G
5%
/

none
496M
168K
495M
1%
/dev

none
500M
0
500M
0%
/dev/shm

none
500M
52K
500M
1%
/var/run

none
500M
0
500M
0%
/var/lock

none
500M
0
500M
0%
/lib/init/rw

/dev/vda1
228M
17M
199M
8%
/boot

master.srv.world:/home
19G
872M
17G
5%
/home

# home directory on NFS is mounted


root@www05:~#
vi /etc/fstab


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

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