Client Mount Options

Now that we have tightened up the server side, we need to make similar changes to the client, otherwise we'll start to see errors when we try to mount the resources. For example, we can't mount them with read-write access if they have been shared with read-only access.

Again, this is very easy to do. We simply supply the NFS-specific options to the mount command and it will take care of it for us.

First let's look at the commands we would need to run for the share options we've defined above. First we'll mount the log area with read-only access onto /data/remote_files/log on any client:

<any client># mount -F nfs -o ro helium:/data/remote_files/log
/data/remote_files/log
<any client>#

Now we'll mount the general area onto boron, with read-write access:

boron# mount -F nfs helium:/data/remote_files/general/data/
remote_files/general
boron#

And finally we'll mount the admin files onto hydrogen, again with read-only access:

nitrogen# mount -F nfs -r helium:/data/remote_files/admin/data/
remote_files/admin
nitrogen#

This time we've used slightly different syntax for mounting the resource read-only. We've used the generic “-r” option rather than the NFS-specific “-o ro” just to show that there are different ways of using the options.

There are many other NFS options available (these can be found in the mount and mount_nfs manual pages), but Table 18.6 shows some of the more commonly used ones.

Table 18.6. Common NFS-Related Mount Options
OptionAccess Required
rw, roMount the device with read-write access (the default) or with read-only access.
fg, bgIf the mount attempt fails, retry it in the foreground (which will cause the local machine boot process to hang if the hard option is also used) or in the background.
hard, soft“Hard” (the default) will send an error if the server does not respond; “soft” will continue retrying.
intr, nointr“Intr” (the default) allows the client to interrupt a hung, hard-mounted resource; “nointr” does not.
suid, nosuid“Suid” (the default) allows setuid programs to be executed; “nosuid” doesn't.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset