3.2. Mounting a GFS2 File System
注意
You should always use Pacemaker to manage the GFS2 file system in a production environment rather than manually mounting the file system with a mount command, as this may cause issues at system shutdown as described in 第 3.3 节 “Unmounting a GFS2 File System”.
Before you can mount a GFS2 file system, the file system must exist (see 第 3.1 节 “Creating a GFS2 File System”), the volume where the file system exists must be activated, and the supporting clustering and locking systems must be started (see Configuring and Managing a Red Hat Cluster). After those requirements have been met, you can mount the GFS2 file system as you would any Linux file system.
For proper operation of the GFS2 file system, the
gfs2-utils
package must be installed on all nodes that mount a GFS2 file system. The gfs2-utils
package is part of the Resilient Storage channel.
要处理文件 ACL,您必须使用
-o acl
挂载信息挂载文件系统。如果挂载文件系统时没有使用 -o acl
选项,用户可以查看 ACL(使用 getfacl
),但不能对其进行设置(使用 setfacl
)。
用法
Mounting Without ACL Manipulation
mount BlockDevice MountPoint
Mounting With ACL Manipulation
mount -o acl BlockDevice MountPoint
-o acl
- GFS2 允许处理文件 ACL 的特定选项。
BlockDevice
- 指定 GFS2 文件系统所在的块设备。
MountPoint
- 指定要挂载 GFS2 文件系统的目录。
示例
在这个示例中,位于
/dev/vg01/lvol0
的 GFS2 文件系统被挂载到 /mygfs2
目录中。
# mount /dev/vg01/lvol0 /mygfs2
完整用法
mountBlockDevice MountPoint
-ooption
The
-o option
argument consists of GFS2-specific options (see 表 3.2 “GFS2 特定挂载选项”) or acceptable standard Linux mount -o
options, or a combination of both. Multiple option
parameters are separated by a comma and no spaces.
注意
mount
命令是 Linux 系统命令。除了使用这部分论述的 GFS2 特定选项,您还可以使用其它标准 mount
命令选项(例如:-r
)。有关其它 Linux mount
命令选项请参考 mount
man page。
表 3.2 “GFS2 特定挂载选项” describes the available GFS2-specific
-o option
values that can be passed to GFS2 at mount time.
注意
This table includes descriptions of options that are used with local file systems only. Note, however, that as of the Red Hat Enterprise Linux 6 release, Red Hat does not support the use of GFS2 as a single-node file system. Red Hat will continue to support single-node GFS2 file systems for mounting snapshots of cluster file systems (for example, for backup purposes).
选项 | 描述 | ||
---|---|---|---|
acl | 允许处理文件 ACL。如果挂载文件系统时没有使用 acl 挂载选项,那么用户可以查看 ACL(使用 getfacl ),但不能对其进行设置(使用 setfacl )。 | ||
data=[ordered|writeback] | When data=ordered is set, the user data modified by a transaction is flushed to the disk before the transaction is committed to disk. This should prevent the user from seeing uninitialized blocks in a file after a crash. When data=writeback mode is set, the user data is written to the disk at any time after it is dirtied; this does not provide the same consistency guarantee as ordered mode, but it should be slightly faster for some workloads. The default value is ordered mode. | ||
| Forces GFS2 to treat the file system as a multi-host file system. By default, using lock_nolock automatically turns on the localflocks flag. | ||
| 告知 GFS2 让 VFS(虚拟文件系统)层完成所有 flock 和 fcntl 操作。lock_nolock 可自动打开 localflocks 标签。 | ||
lockproto= LockModuleName | 允许用户指定文件系统要使用的锁定协议。如果没有指定 LockModuleName ,则会从文件系统的超级块中读取锁定协议。 | ||
locktable= LockTableName | 允许用户指定文件系统要使用的锁定表。 | ||
quota=[off/account/on] | 为文件系统打开或者关闭配额。在 account 状态中配置配额可让文件系统正确维护对每个 UID/GID 使用统计,忽略限制和警告值。默认值为 off 。 | ||
errors=panic|withdraw | When errors=panic is specified, file system errors will cause a kernel panic. When errors=withdraw is specified, which is the default behavior, file system errors will cause the system to withdraw from the file system and make it inaccessible until the next reboot; in some cases the system may remain running. | ||
discard/nodiscard | Causes GFS2 to generate "discard" I/O requests for blocks that have been freed. These can be used by suitable hardware to implement thin provisioning and similar schemes. | ||
barrier/nobarrier | Causes GFS2 to send I/O barriers when flushing the journal. The default value is on . This option is automatically turned off if the underlying device does not support I/O barriers. Use of I/O barriers with GFS2 is highly recommended at all times unless the block device is designed so that it cannot lose its write cache content (for example, if it is on a UPS or it does not have a write cache). | ||
quota_quantum=secs | Sets the number of seconds for which a change in the quota information may sit on one node before being written to the quota file. This is the preferred way to set this parameter. The value is an integer number of seconds greater than zero. The default is 60 seconds. Shorter settings result in faster updates of the lazy quota information and less likelihood of someone exceeding their quota. Longer settings make file system operations involving quotas faster and more efficient. | ||
statfs_quantum=secs | Setting statfs_quantum to 0 is the preferred way to set the slow version of statfs . The default value is 30 secs which sets the maximum time period before statfs changes will be synced to the master statfs file. This can be adjusted to allow for faster, less accurate statfs values or slower more accurate values. When this option is set to 0, statfs will always report the true values. | ||
statfs_percent=value | Provides a bound on the maximum percentage change in the statfs information on a local basis before it is synced back to the master statfs file, even if the time period has not expired. If the setting of statfs_quantum is 0, then this setting is ignored. |