Sharing directories from a NFS Server in HP-UX.
View the currently shared dir:
root@MyHP-Server:/Application/files/data/var/in# exportfs -v
/Application/files -rw=Server0:Server1:Server2:Server3:Server4:Server5.bc:Server6
/Application/files -rw=Server0:Server1:Server2:Server3:Server4:Server5.bc:Server6
The data is in file /etc/exports
root@ MyHP-Server:/Application/files/data/var/in# cat /etc/exports
/Application/files -rw=Server0:Server1:Server2:Server3:Server4:Server5:Server6
root@MyHP-Server:/Application/files/data/var/in# vi /etc/exports
Edit the file and add another host New-Server-To-Share to share
"/etc/exports" 1 line, 117 characters
/Application/files -rw=Server0:Server1:Server2:Server3:Server4:Server5:Server6:New-Server-To-Share
~
~
~
~
~
~
"/etc/exports" 1 line, 144 characters
root@MyHP-Server:/Application/files/data/var/in#
The newly added host has not yet been recognized
root@MyHP-Server:/Application/files/data/var/in# exportfs -v
/Application/files -rw=Server0:Server1:Server2:Server3:Server4:Server5:Server6
root@MyHP-Server:/Application/files/data/var/in#
Run exportfs -a to share the dir to all host again. Now the new host will be recognized.
root@MyHP-Server:/Application/files/data/var/in# exportfs -a
exportfs error: Server1: unknown host
exportfs error: Server2: unknown host
exportfs error: Server3: unknown host
root@MyHP-Server:/Application/files/data/var/in#
root@MyHP-Server:/Application/files/data/var/in# exportfs -v
/Application/files -rw=Server0:Server1:Server2:Server3:Server4:Server5.bc:Server6:New-Server-To-Share
root@MyHP-Server:/Application/files/data/var/in#
root@MyHP-Server:/Application/files/data/var/in#
root@MyHP-Server:/Application/files/data/var/in# cat /etc/xtab
/Application/files -rw= Server0:Server1:Server2:Server3:Server4:Server5.bc:Server6:New-Server-To-Share
Some examples from Man pages and files associated with NFS:
List currently exported directories and files:
exportfs
Export entries in /etc/exports
exportfs -a
Unexport all exported files and directories:
exportfs -ua
Unexport all exported files and directories and print each directory or filename as it is unexported:
exportfs -uav
Export /usr to the world, ignoring options in /etc/exports:
exportfs -i /usr
Export /usr/bin and /usr/adm read-only to the world:
exportfs -i -o ro /usr/bin /usr/adm
Export /usr/bin read-write only to systems polk and vanness:
exportfs -i -o rw=polk:vanness /usr/bin
Export root access on /usr/adm only to the system named pine, and mount access to both pine and geary:
exportfs -i -o root=pine, access=pine:geary /usr/adm
FILES associated with nfs:
/etc/exports static export information
/etc/xtab current state of exported directories
/etc/netgroup list of network groups
exportfs
Export entries in /etc/exports
exportfs -a
Unexport all exported files and directories:
exportfs -ua
Unexport all exported files and directories and print each directory or filename as it is unexported:
exportfs -uav
Export /usr to the world, ignoring options in /etc/exports:
exportfs -i /usr
Export /usr/bin and /usr/adm read-only to the world:
exportfs -i -o ro /usr/bin /usr/adm
Export /usr/bin read-write only to systems polk and vanness:
exportfs -i -o rw=polk:vanness /usr/bin
Export root access on /usr/adm only to the system named pine, and mount access to both pine and geary:
exportfs -i -o root=pine, access=pine:geary /usr/adm
FILES associated with nfs:
/etc/exports static export information
/etc/xtab current state of exported directories
/etc/netgroup list of network groups
No comments:
Post a Comment