Advertisements

Exporting directory using NFS on Red Hat Enterprise Linux 6.7 and mounting on other server

I will mount a filesystem called /export/mnt/HD0/global and /export/mnt/HD0/profile being exported on linux01.

Both servers are running Red Hat Enterprise Linux 6.7

Checking filesystem that will be exported

root@linux01:~ # df -h /mnt/HD0/global
Filesystem Size Used Avail Use% Mounted on
linux01:/export/mnt/HD0/global
3.5G 23M 3.3G 1% /mnt/HD0/global

root@linux01:~ # df -h /mnt/HD0/profile
Filesystem Size Used Avail Use% Mounted on
linux01:/export/mnt/HD0/profile
3.5G 3.0M 3.3G 1% /mnt/HD0/profile

Checking which filesystems are being exported from linux01

root@linux02:~ # showmount -e linux01
Export list for linux01:
/export/mnt/HD0/exe linux01.setaoffice.com
/export/mnt/HD0/profile linux01.setaoffice.com
/export/mnt/HD0/global linux01.setaoffice.com
/export/interface/SAP linux01.setaoffice.com
/export/interface/HD0 linux01.setaoffice.com

Edit file /etc/exports on linux01 to export the share to linux02

root@linux01:~ # vi /etc/exports
/export/interface/HD0 linux01(rw,no_root_squash,sync)
/export/interface/SAP linux01(rw,no_root_squash,sync)
/export/mnt/HD0/global linux01(rw,no_root_squash,sync) linux02(rw,no_root_squash,sync)
/export/mnt/HD0/profile linux01(rw,no_root_squash,sync) linux02(rw,no_root_squash,sync)
/export/mnt/HD0/exe linux01(rw,no_root_squash,sync)

I stopped and started NFS

root@linux01:~ # /etc/init.d/nfs stop
Shutting down NFS daemon: [FAILED]
Shutting down NFS mountd: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Shutting down RPC idmapd: [ OK ]
root@linux01:~ # /etc/init.d/nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: [ OK ]
Starting RPC idmapd: [ OK ]

Mounting and checking the NFS share

root@linux02:~ # mount linux01:/export/mnt/HD0/profile /mnt/HD0/profile
root@linux02:~ #

root@linux02:~ # mount linux01:/export/mnt/HD0/global /mnt/HD0/global
root@linux02:~ #

root@linux02:~ # df -h /mnt/HD0/profile
Filesystem Size Used Avail Use% Mounted on
linux01:/export/mnt/HD0/profile
3.5G 3.0M 3.3G 1% /mnt/HD0/profile

root@linux02:~ # df -h /mnt/HD0/global
Filesystem Size Used Avail Use% Mounted on
linux01:/export/mnt/HD0/global
3.5G 23M 3.3G 1% /mnt/HD0/global

Advertisements
%d bloggers like this: