Managing NFS and NIS, 2nd Edition - Mike Eisler [63]
* * *
The Solaris mount command syntax for mounting NFS filesystems is:
mount [ -F nfs ] [-mrO] [ -o suboptions ] server:pathname
mount [ -F nfs ] [-mrO] [ -o suboptions ] mount_point
mount [ -F nfs ] [-mrO] [ -o suboptions ] server:pathname mount_point
mount [ -F nfs ] [-mrO] [ -o suboptions ]
server1:pathname1,server2:pathname2,...serverN:pathnameN mount_point
mount [ -F nfs ] [-mrO] [ -o suboptions ]
server1,server2,...serverN:pathname mount_point
The first two forms are used when mounting a filesystem listed in the vfstab file. Note that server is the hostname of the NFS server. The last two forms are used when mounting replicas. See Section 6.6 later in this chapter.
The -F nfs option is used to specify that the filesystem being mounted is of type NFS. The option is not necessary because the filesystem type can be discerned from the presence of host:pathname on the command line.
The -r option says to mount the filesystem as read-only. The preferred way to specify read-only is the ro suboption to the -o option.
The -m option says to not record the entry in the /etc/mnttab file.
The -O option says to permit the filesystem to be mounted over an existing mount point. Normally if mount_point already has a filesystem mounted on it, the mount command will fail with a filesystem busy error.
In addition, you can use -o to specify suboptions. Suboptions can also be specified (without -o) in the mount options field in / etc/vfstab. The common NFS mount suboptions are:
rw/ro
rw mounts a filesystem as read-write; this is the default. If ro is specified, the filesystem is mounted as read-only. Use the ro option if the server enforces write protection for various filesystems.
bg/fg
The bg option tells mount to retry a failed mount attempt in the background, allowing the foreground mount process to continue. By default, NFS mounts are not performed in the background, so fg is the default. We'll discuss the bg option further in the next section. Note that the bg option does not apply to the automounter (see Chapter 9).
grpid
Since Solaris is a derivative of Unix System V, it will by default obey System V semantics. One area in which System V differs from 4.x BSD systems is in the group identifier of newly created files. System V will set the group identifier to the effective group identifier of the calling process. If the grpid option is set, BSD semantics are used, and so the group identifier is always inherited from the file's directory. You can control this behavior on a per-directory basis by not specifying grpid, and instead setting the set group id bit on the directory with the chmod command:
% chmod g+s /export/home/dir
If the set group id bit is set, then even if grpid is absent, the group identifier of a created file is inherited from the group identifier of the file's directory. So for example:
% chmod g+s /export/home/dir
% ls -ld /export/home/dir
drwxr-sr-x 6 mre writers 3584 May 24 09:17
/export/home/dir/
% touch /export/home/dir/test
% ls -l /export/home/dir/test
-rw-r--r-- 1 mre writers 0 May 27 06:07 /export/home/dir/test
quota/noquota
Enables/prevents the quota command to check for quotas on the filesystem.
port=n
Specify the port number of the NFS server. The default is to use the port number as returned by the rpcbind. This option is typically used to support pseudo NFS servers that run on the same machine as the NFS client. The Solaris removable media (CD-ROMs and floppy disks) manager (vold ) is an example of such a server.
public
This option is useful for environments that have to cope with firewalls. We will discuss it in more detail in Chapter 12 .
suid/nosuid
Under some situations, the nosuid option prevents security exposures. The default is suid. We will go into more detail in Chapter 12.
sec=mode
This option lets you set the security mode used on the filesystem. Valid security modes are as specified in Section 6.2.2 earlier in this chapter. If you're using NFS Version 3, normally you need not be concerned