Download  Print this page


Hide thumbs


Red Hat Enterprise Linux 5
Global File System 2
Red Hat Global File System 2



  Summary of Contents for Red Hat ENTERPRISE LINUX 5 - GLOBAL FILE SYSTEM 2

  • Page 1 Red Hat Enterprise Linux 5 Global File System 2 Red Hat Global File System 2...
  • Page 2 Global File System 2 Red Hat Enterprise Linux 5 Global File System 2 Red Hat Global File System 2 Edition 7 Copyright © 2010 Red Hat Inc.. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA").
  • Page 3: Table Of Contents

    Introduction 1. Audience ........................v 2. Related Documentation ....................v 3. Feedback 4. Document Conventions 4.1. Typographic Conventions 4.2. Pull-quote Conventions ..................viii 4.3. Notes and Warnings ................... viii 1. GFS2 Overview 1.1. Before Setting Up GFS2 ....................2 1.2.
  • Page 5 Cluster Suite see Red Hat Cluster Suite Overview and Configuring and Managing a Red Hat Cluster. HTML and PDF versions of all the official Red Hat Enterprise Linux manuals and release notes are available online at 1. Audience This book is intended primarily for Linux system administrators who are familiar with the following activities: •...
  • Page 6 3. Feedback If you spot a typo, or if you have thought of a way to make this manual better, we would love to hear from you. Please submit a report in Bugzilla ( against the component Documentation-cluster. Be sure to mention the manual's identifier: rh-gfs2(EN)-5 (2010-03-12T15:15) By mentioning this manual's identifier, we know exactly which version of the guide you have.
  • Page 7 Typographic Conventions Press Enter to execute the command. Press Ctrl+Alt+F1 to switch to the first virtual terminal. Press Ctrl+Alt+F7 to return to your X-Windows session. The first paragraph highlights the particular keycap to press. The second highlights two key combinations (each a set of three keycaps with each set pressed simultaneously). If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in mono-spaced bold.
  • Page 8 Introduction Note the words in bold italics above — username,, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system. Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term.
  • Page 9 Notes and Warnings Ignoring a box labeled 'Important' won't cause data loss but may cause irritation and frustration. Warning Warnings should not be ignored. Ignoring warnings will most likely cause data loss.
  • Page 11: Gfs2 Overview

    Chapter 1. GFS2 Overview The Red Hat GFS2 file system is a native file system that interfaces directly with the Linux kernel file system interface (VFS layer). When implemented as a cluster file system, GFS2 employs distributed metadata and multiple journals. Red Hat supports the use of GFS2 file systems only as implemented in Red Hat Cluster Suite.
  • Page 12: Before Setting Up Gfs2

    Chapter 1. GFS2 Overview Note When you configure a GFS2 file system as a cluster file system, you must ensure that all nodes in the cluster have access to the shared storage. Asymmetric cluster configurations in which some nodes have access to the shared storage and others do not are not supported.
  • Page 13: Differences Between Gfs And Gfs2

    Differences between GFS and GFS2 1.2. Differences between GFS and GFS2 This section lists the improvements and changes that GFS2 offers over GFS. Migrating from GFS to GFS2 requires that you convert your GFS file systems to GFS2 with the Appendix A, Converting a gfs2_convert utility.
  • Page 14 Chapter 1. GFS2 Overview Context-Dependent Path Names GFS2 file systems do not provide support for context-dependent path names, which allow you to create symbolic links that point to variable destination files or directories. For this functionality in GFS2, you can use the bind option of the mount command. For information on managing pathnames Section 3.12, “Bind Mounts and Context-Dependent Path Names”.
  • Page 15: Gfs2 Performance Improvements

    GFS2 Performance Improvements The gfs2_tool command The gfs2_tool command supports a different set of options for GFS2 than the gfs_tool command supports for GFS: • The gfs2_tool command supports a journals parameter that prints out information about the currently configured journals, including how many journals the file system contains. •...
  • Page 16 Chapter 1. GFS2 Overview • GFS2 uses less kernel memory • GFS2 requires no metadata generation numbers. Allocating GFS2 metadata does not require reads. Copies of metadata blocks in multiple journals are managed by revoking blocks from the journal before lock release. •...
  • Page 17: Getting Started

    Chapter 2. Getting Started This chapter describes procedures for initial setup of GFS2 and contains the following sections: Section 2.1, “Prerequisite Tasks” • Section 2.2, “Initial Setup Tasks” • 2.1. Prerequisite Tasks Before setting up Red Hat GFS2, make sure that you have noted the key characteristics of the GFS2 Section 1.1, “Before Setting Up GFS2”).
  • Page 18 Chapter 2. Getting Started mkfs -t gfs2 -p lock_dlm -t LockTableName -j NumberJournals BlockDevice You can use either of the following formats to create a local GFS2 file system: mkfs.gfs2 -p lock_nolock -j NumberJournals BlockDevice mkfs -t gfs2 -p lock_nolock -j NumberJournals BlockDevice Section 3.1, “Making a File System”.
  • Page 19: Managing Gfs2

    Chapter 3. Managing GFS2 This chapter describes the tasks and commands for managing GFS2 and consists of the following sections: Section 3.1, “Making a File System” • Section 3.2, “Mounting a File System” • Section 3.3, “Unmounting a File System” •...
  • Page 20 Chapter 3. Managing GFS2 Usage When creating a clustered GFS2 filesystem, you can use either of the following formats: mkfs.gfs2 -p LockProtoName -t LockTableName -j NumberJournals BlockDevice mkfs -t gfs2 -p LockProtoName -t LockTableName -j NumberJournals BlockDevice When creating a local GFS2 filesystem, you can use either of the following formats: Note For the RHEL 5.5 release and later Red Hat does not support the use of GFS2 as a single-node file system.
  • Page 21 Examples BlockDevice Specifies a logical or physical volume. Examples In these examples, lock_dlm is the locking protocol that the file system uses, since this is a clustered file system. The cluster name is alpha, and the file system name is mydata1. The file system contains eight journals and is created on /dev/vg01/lvol0.
  • Page 22: Mounting A File System

    Chapter 3. Managing GFS2 Flag Parameter Description Specifies the name of the locking protocol to use. LockProtoName Recognized locking protocols include: lock_dlm — The standard locking module, required for a clustered file system. lock_nolock — Used when GFS2 is acting as a local file system (one node only).
  • Page 23: Mount Options

    Usage Usage Mounting Without ACL Manipulation mount BlockDevice MountPoint Mounting With ACL Manipulation mount -o acl BlockDevice MountPoint -o acl GFS2-specific option to allow manipulating file ACLs. BlockDevice Specifies the block device where the GFS2 file system resides. MountPoint Specifies the directory where the GFS2 file system should be mounted. Example In this example, the GFS2 file system on /dev/vg01/lvol0 is mounted on the /mygfs2 directory.
  • Page 24 Chapter 3. Managing GFS2 node file system. Red Hat will continue to support single-node GFS2 file systems for existing customers. Option Description Allows manipulating file ACLs. If a file system is mounted without the acl mount option, users are allowed to view ACLs (with getfacl), but are not allowed to set them (with setfacl).
  • Page 25: Umount Command

    Unmounting a File System 3.3. Unmounting a File System The GFS2 file system can be unmounted the same way as any Linux file system — by using the umount command. Note The umount command is a Linux system command. Information about this command can be found in the Linux umount command man pages.
  • Page 26: Setting Quotas

    Chapter 3. Managing GFS2 GFS2 uses its gfs2_quota command to manage quotas. Other Linux quota facilities cannot be used with GFS2. 3.5.1. Setting Quotas Two quota settings are available for each user ID (UID) or group ID (GID): a hard limit and a warn limit.
  • Page 27: Displaying Quota Limits And Usage

    Displaying Quota Limits and Usage Examples This example sets the hard limit for user Bert to 1024 megabytes (1 gigabyte) on file system / mygfs2. gfs2_quota limit -u Bert -l 1024 -f /mygfs2 This example sets the warn limit for group ID 21 to 50 kilobytes on file system /mygfs2. gfs2_quota warn -g 21 -l 50 -k -f /mygfs2 3.5.2.
  • Page 28: Synchronizing Quotas

    Chapter 3. Managing GFS2 user User: limit:LimitSize warn:WarnSize value:Value group Group: limit:LimitSize warn:WarnSize value:Value The LimitSize, WarnSize, and Value numbers (values) are in units of megabytes by default. Adding the -k, -s, or -b flags to the command line change the units to kilobytes, sectors, or file system blocks, respectively.
  • Page 29: Enabling/Disabling Quota Enforcement

    Enabling/Disabling Quota Enforcement parameter must be set on each node and each time the file system is mounted. (Changes to the quota_quantum parameter are not persistent across unmounts.) You can use the gfs2_quota sync command to synchronize the quota information from a node to the on-disk quota file between the automatic updates performed by GFS2.
  • Page 30: Enabling Quota Accounting

    Chapter 3. Managing GFS2 To mount a file system with quota enforcement disabled, mount the file system with the quota=off option specified. This is the default setting. mount -o quota=off BlockDevice MountPoint -o quota={on|off} Specifies that quota enforcement is enabled or disabled when the file system is mounted. BlockDevice Specifies the block device where the GFS2 file system resides.
  • Page 31: Growing A File System

    Growing a File System 3.6. Growing a File System The gfs2_grow command is used to expand a GFS2 file system after the device where the file system resides has been expanded. Running a gfs2_grow command on an existing GFS2 file system fills all spare space between the current end of the file system and the end of the device with a newly initialized GFS2 file system extension.
  • Page 32: Adding Journals To A File System

    Chapter 3. Managing GFS2 gfs2_grow complete. Complete Usage gfs2_grow [Options] {MountPoint | Device} [MountPoint | Device] MountPoint Specifies the directory where the GFS2 file system is mounted. Device Specifies the device node of the file system. Table 3.3, “GFS2-specific Options Available While Expanding A File System” describes the GFS2- specific options that can be used while expanding a GFS2 file system.
  • Page 33 Usage journal0 - 128MB 3 journal(s) found. Usage gfs2_jadd -j Number MountPoint Number Specifies the number of new journals to be added. MountPoint Specifies the directory where the GFS2 file system is mounted. Examples In this example, one journal is added to the file system on the /mygfs2 directory. gfs2_jadd -j1 /mygfs2 In this example, two journals are added to the file system on the /mygfs2 directory.
  • Page 34: Data Journaling

    Chapter 3. Managing GFS2 Flag Parameter Description Specifies the number of new journals to be added by the Number gfs2_jadd command. The default value is 1. Quiet. Turns down the verbosity level. Displays command version information. Table 3.4. GFS2-specific Options Available When Adding Journals 3.8.
  • Page 35: Configuring Atime Updates

    Configuring atime Updates ---------j--- /mnt/gfs2/gfs2_dir [root@roth-01 ~]# touch /mnt/gfs2/gfs2_dir/newfile [root@roth-01 ~]# lsattr /mnt/gfs2/gfs2_dir ---------j--- /mnt/gfs2/gfs2_dir/newfile 3.9. Configuring atime Updates Each file inode and directory inode has three time stamps associated with it: • ctime — The last time the inode status was changed •...
  • Page 36: Mount With Noatime

    Chapter 3. Managing GFS2 3.9.2. Mount with noatime The noatime Linux mount option can be specified when the file system is mounted, which disables atime updates on that file system. Usage mount BlockDevice MountPoint -o noatime BlockDevice Specifies the block device where the GFS2 file system resides. MountPoint Specifies the directory where the GFS2 file system should be mounted.
  • Page 37: Repairing A File System

    Repairing a File System gfs2_tool unfreeze /mygfs2 3.11. Repairing a File System When nodes fail with the file system mounted, file system journaling allows fast recovery. However, if a storage device loses power or is physically disconnected, file system corruption may occur. (Journaling cannot be used to recover from storage subsystem failures.) When that type of corruption occurs, you can recover the GFS2 file system by using the fsck.gfs2 command.
  • Page 38 Chapter 3. Managing GFS2 Since this file system contains 4294967296 blocks, multiply that number by 5/8 to determine how many bytes of memory are required: 4294967296 * 5/8 = 2684354560 This file system requires approximately 2.6GB of free memory to run the fsck.gfs2 command. Note that if the block size was 1K, running the fsck.gfs2 command would require four times the memory, or approximately 11GB.
  • Page 39: Bind Mounts And Context-Dependent Path Names

    Bind Mounts and Context-Dependent Path Names 3.12. Bind Mounts and Context-Dependent Path Names GFS2 file systems do not provide support for Context-Dependent Path Names (CDPNs), which allow you to create symbolic links that point to variable destination files or directories. For this functionality in GFS2, you can use the bind option of the mount command.
  • Page 40: Bind Mounts And File System Mount Order

    Chapter 3. Managing GFS2 Alternately, you can use the following entry in the /etc/fstab file. /usr/1386-bin /bin none bind A bind mount can provide greater flexibility than a Context-Dependent Path Name, since you can use this feature to mount different directories according to any criteria you define (such as the value of %fill for the file system).
  • Page 41 Bind Mounts and File System Mount Order The following script is an example of a custom init script. This script performs a bind mount of two directories onto two directories of a GFS2 filesystem. In this example, there is an existing GFS2 mount point at /mnt/gfs2a, which is mounted when the GFS2 init script runs, after cluster startup.
  • Page 42: The Gfs2 Withdraw Function

    Chapter 3. Managing GFS2 reload) $0 start echo $"Usage: $0 {start|stop|restart|reload|status}" exit 1 esac exit 0 3.14. The GFS2 Withdraw Function The GF2S withdraw function is a data integrity feature of GFS2 file systems in a cluster. If the GFS2 kernel module detects an inconsistency in a GFS2 file system following an I/O operation, the file system becomes unavailable to the cluster.
  • Page 43 The GFS2 Withdraw Function cause the system to withdraw cause the system to panic instead. This stops the node's cluster communications, which causes the node to be fenced.
  • Page 45: A. Converting A File System From Gfs To Gfs2

    Appendix A. Converting a File System from GFS to GFS2 Use the gfs2_convert command. To convert a GFS file system to a GFS2 file system. Warning If the conversion from GFS to GFS2 is interrupted by a power failure or any other issue, restart the conversion tool.
  • Page 47: B. Revision History

    Appendix B. Revision History Revision 5.5-1 Thu Mar 11 2010 Steven Levine Resolves: #546687 Documents features for the RHEL 5.5 release. Resolves: #568179 Adds note clarifying support policy for single-node system. Resolves: #562199 Adds note clairfying 16-node limitation. Resolves: #515348 Documents new -o errors mount option.
  • Page 49: Index

    Index GFS2 atime, configuring updates, 25 mounting with noatime, 26 mounting with relatime, 25 acl mount option, 12 managing, 9 adding journals to a file system, 22 quota management, 15 atime, configuring updates, 25 displaying quota limits, 17 mounting with noatime, 26 enabling quota accounting, 20 mounting with relatime, 25 enabling/disabling quota enforcement, 19...
  • Page 50 Index quota management, 15 displaying quota limits, 17 enabling quota accounting, 20 enabling/disabling quota enforcement, 19 setting quotas, 16 synchronizing quotas, 18 quota= mount option, 16 quota_quantum tunable parameter, 18 repairing a file system, 27 setup, initial initial tasks, 7 suspending activity on a file system, 26 system hang at unmount, 15 tables...

This manual is also suitable for:

Global file system 2