이 블로그 검색

일요일, 6월 17, 2012

[Linux]NFS

#apt-get install nfs-kernel-server nfs-common rpcbind

[Server side]
in /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes  gss/krb5i(rw,sync)
#
/home           192.168.0.101(rw,sync,no_root_squash)
/var/nfs        192.168.0.101(rw,sync)
 
(The no_root_squash option makes that /home will be accessed as root.)
Whenever we modify /etc/exports, we must run

#exportfs -a

afterwards to make the changes effective.

[Client side]
mkdir -p /mnt/nfs/home
mkdir -p /mnt/nfs/var/nfs
Afterwards, we can mount them as follows:
mount 192.168.0.100:/home /mnt/nfs/home
mount 192.168.0.100:/var/nfs /mnt/nfs/var/nfs

 

댓글 없음:

댓글 쓰기