Determine which nodes in the cluster will mount the GFS2 file systems.
Determine how many GFS2 file systems to create initially. (More file systems can be added later.)
Determine a unique name for each file system. The name must be unique for all
lock_dlm
file systems over the cluster. Each file system name is required in the form of a parameter variable.
Determine the number of journals for your GFS2 file systems. One journal is required for each node that mounts a GFS2 file system. GFS2 allows you to add journals dynamically at a later point as additional servers mount a file system.
Determine the storage devices and partitions to be used for creating logical volumes (via CLVM) in the file systems.
GFS Command | GFS2 Command | Description | ||||
---|---|---|---|---|---|---|
mount | mount | Mount a file system. The system can determine whether the file system is a GFS or GFS2 file system type. For information on the GFS2 mount options see the gfs2_mount(8) man page. | ||||
umount | umount | Unmount a file system. | ||||
|
| Check and repair an unmounted file system. | ||||
gfs_grow | gfs2_grow | Grow a mounted file system. | ||||
gfs_jadd | gfs2_jadd | Add a journal to a mounted file system. | ||||
|
| Create a file system on a storage device. | ||||
gfs_quota | gfs2_quota | Manage quotas on a mounted file system. As of the Red Hat Enterprise Linux 6.1 release, GFS2 supports the standard Linux quota facilities. For further information on quota management in GFS2, refer to | ||||
gfs_tool | tunegfs2
mount parameters
dmsetup suspend | Configure, tune, or gather information about a file system. The tunegfs2 command is supported as of the Red Hat Enterprise Linux 6.2 release. There is also a gfs2_tool command. | ||||
gfs_edit | gfs2_edit | Display, print, or edit file system internal structures. The gfs2_edit command can be used for GFS file systems as well as GFS2 file system. | ||||
gfs_tool setflag jdata/inherit_jdata | chattr +j (preferred) | Enable journaling on a file or directory. | ||||
setfacl/getfacl | setfacl/getfacl | Set or get file access control list for a file or directory. | ||||
setfattr/getfattr | setfattr/getfattr | Set or get the extended attributes of a file. |
Create a partition either on shared storage lun or any other normal partition
then format with gfs2 file system.
mkfs.gfs2 -p lock_dlm -tClusterName:FSName
-jNumberJournals BlockDevice
LockProtoName
Specifies the name of the locking protocol to use. The lock protocol for a cluster is lock_dlm
.
LockTableName
This parameter is specified for GFS2 file system in a cluster configuration. It has two parts separated by a colon (no spaces) as follows: ClusterName:FSName
-
ClusterName
, the name of the cluster for which the GFS2 file system is being created.
-
FSName
, the file system name, can be 1 to 16 characters long. The name must be unique for all lock_dlm
file systems over the cluster, and for all file systems (lock_dlm
and lock_nolock
) on each local node.
Number
Specifies the number of journals to be created by the mkfs.gfs2
command. One journal is required for each node that mounts the file system. For GFS2 file systems, more journals can be added later without growing the file system, as described in
BlockDevice
Specifies a logical or physical volume
mkfs -t gfs2 -p lock_dlm -t HA:ktsgfs2 -j 2 /dev/vdb1
mount /dev/vdb1 /GFS
chkconfig –level 345 gfs2 on
gfs2_tool list
gfs2_tool df
gfs2_tool df
echo “/dev/vdb1 /GFS gfs2 defaults,noatime,nodiratime 0 0″ >> /etc/fstab
If GFS file system has to be on an lvm then follow below steps.
pvcreate pv_gfs2 /dev/vdb1
vgcreate -c y vg_gfs2 /dev/sdb
lvcreate -n lv_gfs2 -L 2G mytest_gfs2
/etc/init.d/clvmd start
format the lvm via above commands.
If GFS file system has to be on an lvm then follow below steps.
pvcreate pv_gfs2 /dev/vdb1
vgcreate -c y vg_gfs2 /dev/sdb
lvcreate -n lv_gfs2 -L 2G mytest_gfs2
/etc/init.d/clvmd start
format the lvm via above commands.