티스토리 뷰

EN/CentOS 5

CentOS 5 NFS Server

ServerWorld 2016.05.29 13:43

CentOS 5 NFS Server


NFS Server

 

Configure NFS Server to share any directories on your Network.



1. It's the Configuration on the system you want to build NFS server.


[root@centos5 ~]# yum -y install nfs-utils


[root@centos5 ~]# vi /etc/idmapd.conf

# line 5: uncomment and change to your domain name

Domain = srv.world


[root@centos5 ~]# vi /etc/exports

# set like follows *note

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


# *note

/home ⇒ shared directory

10.0.0.0/24 ⇒ range of networks NFS permits accesses

rw ⇒ writable

sync ⇒ synchronize

no_root_squash ⇒ enable root privilege

no_all_squash ⇒ enable users' authority


[root@centos5 ~]# /etc/rc.d/init.d/portmap start 

Starting portmap: [ OK ]


[root@centos5 ~]# /etc/rc.d/init.d/nfslock start 

Starting NFS statd: [ OK ]


[root@centos5 ~]# /etc/rc.d/init.d/nfs start 

Starting NFS services:[ OK ]

Starting NFS quotas:[ OK ]

Starting NFS daemon:[ OK ]

Starting NFS mountd:[ OK ]

Starting RPC idmapd:[ OK ]


[root@centos5 ~]# chkconfig portmap on 

[root@centos5 ~]# chkconfig nfslock on 

[root@centos5 ~]# chkconfig nfs on 




2. Configuration on NFS clients.


[root@www ~]# yum -y install nfs-utils


[root@www ~]# vi /etc/idmapd.conf

# line 5: uncomment and change to your domain name

Domain = srv.world


[root@www ~]# /etc/rc.d/init.d/portmap start 

Starting portmap: [ OK ]


[root@www ~]# /etc/rc.d/init.d/nfslock start 

Starting NFS statd: [ OK ]


[root@www ~]# /etc/rc.d/init.d/netfs start 

Mounting other filesystems: [ OK ]


[root@www ~]# chkconfig portmap on 

[root@www ~]# chkconfig nfslock on 

[root@www ~]# chkconfig netfs on 


[root@www ~]# mount -t nfs centos5.srv.world:/home /home 


[root@www ~]# df -h 

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_00-lv_00

                       26G  1.1G   23G   5% /

/dev/sda1              99M   13M   82M  14% /boot

tmpfs                1006M     0 1006M   0% /dev/shm

centos5.srv.world:/home

                      280G  1.3G  264G   1% /home


# home directory from NFS server is mounted

[root@www ~]# vi /etc/fstab 


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

/dev/vg_00/lv_00        /                       ext3    defaults        1 1

LABEL=/boot             /boot                   ext3    defaults        1 2

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/vg_00/lv_01        swap                    swap    defaults        0 0

 centos5.srv.world:/home  /home                   nfs     defaults        1 1


※ Next manual


저작자 표시 비영리 변경 금지
신고

'EN > CentOS 5' 카테고리의 다른 글

CentOS 5 Configure LDAP Server  (0) 2016.05.31
CentOS 5 Configure NIS Server  (0) 2016.05.31
CentOS 5 NFS Server  (0) 2016.05.29
CentOS 5 Install VirtualBox  (0) 2016.05.29
CentOS 5 Install VMware Player  (0) 2016.05.29
CentOS 5 KVM basic Operations  (0) 2016.05.28
댓글