Sharing file systems with nfs server and mounting file systems with nfs client: Difference between revisions
No edit summary |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
=Sharing file systems with nfs server= | =Sharing file systems with nfs server= | ||
/nfs/home lives on the machine dalet. | |||
lives on the machine dalet. | |||
Login using an s_ account to dalet | Login using an s_ account to dalet | ||
Line 7: | Line 6: | ||
The /etc/exports says which file systems will be exported to which networks. | The /etc/exports says which file systems will be exported to which networks. | ||
Note: fsid must be unique. | |||
less /etc/exports | less /etc/exports | ||
Example row: | Example row: | ||
/export/home 10.20.0.0/16(rw,async,fsid=221) \ | /export/home 10.20.0.0/16(rw,async,fsid=221) \ | ||
Line 18: | Line 17: | ||
The alternative is sync which makes all writes to the file be committed to the server. Sync is slower. | The alternative is sync which makes all writes to the file be committed to the server. Sync is slower. | ||
Before running mounting, there are 2 things you need to check: | |||
1. /sbin/service nfs status | |||
Shows all the places where nfs is running | |||
2. /sbin/service rpcbind status | |||
Shows whether rpcbind is running. Rpcbind needs to be running for nfs to work correctly. | |||
/sbin/chkconfig | grep nfs | |||
chkconfig controls whether a program automatically starts itself in the background at boot time | |||
Need to run as root | |||
exportfs | |||
Shows all the subnets where nfs is exported | |||
showmount -e localhost | |||
Shows what is mounted on localhost | |||
[[File:showmount.png | 700px ]] | |||
=Mounting file systems with nfs client= | =Mounting file systems with nfs client= | ||
[[ Category: Ben ]] [[ Category: | mount | grep nfs | ||
Shows what is mounted | |||
[[File:mounted.png | 700px ]] | |||
/etc/fstab | |||
Shows the file system table. This is not edited manually and is controlled by puppet. If any changes are made, every 30 minutes the puppet master will check for changes and change the file to match the puppet master. | |||
Columns explanation: 1. Disk partition 2. Mount point 3. Type of file system 4. Important to have netdev on mounts that require network. This way, you will not try to mount these unless you have a network connection. | |||
service puppet status | |||
Tells you whether puppet is running and what the process ID is. | |||
puppet agent --test | |||
Puppet can tell if client machine is missing required mounts. Blue means puppet is working correctly. | |||
[[File:puppet_status.png | 700px ]] | |||
mount -a | |||
If someone says things are not properly mounted on their machine, login as root on their machine and run this command. | |||
[[ Category: Ben ]] [[ Category: Sysadmin ]] |
Latest revision as of 17:08, 21 July 2020
Sharing file systems with nfs server
/nfs/home lives on the machine dalet.
Login using an s_ account to dalet
ssh s_jyoung@dalet
The /etc/exports says which file systems will be exported to which networks. Note: fsid must be unique.
less /etc/exports
Example row:
/export/home 10.20.0.0/16(rw,async,fsid=221) \ 169.230.26.0/24(rw,async,fsid=221) \
rw means read/write
async means that writes to the file are not transmitted to the server immediately, usually only when the file is closed.
The alternative is sync which makes all writes to the file be committed to the server. Sync is slower.
Before running mounting, there are 2 things you need to check:
1. /sbin/service nfs status
Shows all the places where nfs is running
2. /sbin/service rpcbind status
Shows whether rpcbind is running. Rpcbind needs to be running for nfs to work correctly.
/sbin/chkconfig | grep nfs
chkconfig controls whether a program automatically starts itself in the background at boot time
Need to run as root
exportfs
Shows all the subnets where nfs is exported
showmount -e localhost
Shows what is mounted on localhost
Mounting file systems with nfs client
mount | grep nfs
Shows what is mounted
/etc/fstab
Shows the file system table. This is not edited manually and is controlled by puppet. If any changes are made, every 30 minutes the puppet master will check for changes and change the file to match the puppet master. Columns explanation: 1. Disk partition 2. Mount point 3. Type of file system 4. Important to have netdev on mounts that require network. This way, you will not try to mount these unless you have a network connection.
service puppet status
Tells you whether puppet is running and what the process ID is.
puppet agent --test
Puppet can tell if client machine is missing required mounts. Blue means puppet is working correctly.
mount -a
If someone says things are not properly mounted on their machine, login as root on their machine and run this command.