xref: /OK3568_Linux_fs/kernel/Documentation/filesystems/gfs2.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun==================
4*4882a593SmuzhiyunGlobal File System
5*4882a593Smuzhiyun==================
6*4882a593Smuzhiyun
7*4882a593Smuzhiyunhttps://fedorahosted.org/cluster/wiki/HomePage
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunGFS is a cluster file system. It allows a cluster of computers to
10*4882a593Smuzhiyunsimultaneously use a block device that is shared between them (with FC,
11*4882a593SmuzhiyuniSCSI, NBD, etc).  GFS reads and writes to the block device like a local
12*4882a593Smuzhiyunfile system, but also uses a lock module to allow the computers coordinate
13*4882a593Smuzhiyuntheir I/O so file system consistency is maintained.  One of the nifty
14*4882a593Smuzhiyunfeatures of GFS is perfect consistency -- changes made to the file system
15*4882a593Smuzhiyunon one machine show up immediately on all other machines in the cluster.
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunGFS uses interchangeable inter-node locking mechanisms, the currently
18*4882a593Smuzhiyunsupported mechanisms are:
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun  lock_nolock
21*4882a593Smuzhiyun    - allows gfs to be used as a local file system
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun  lock_dlm
24*4882a593Smuzhiyun    - uses a distributed lock manager (dlm) for inter-node locking.
25*4882a593Smuzhiyun      The dlm is found at linux/fs/dlm/
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunLock_dlm depends on user space cluster management systems found
28*4882a593Smuzhiyunat the URL above.
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunTo use gfs as a local file system, no external clustering systems are
31*4882a593Smuzhiyunneeded, simply::
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun  $ mkfs -t gfs2 -p lock_nolock -j 1 /dev/block_device
34*4882a593Smuzhiyun  $ mount -t gfs2 /dev/block_device /dir
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunIf you are using Fedora, you need to install the gfs2-utils package
37*4882a593Smuzhiyunand, for lock_dlm, you will also need to install the cman package
38*4882a593Smuzhiyunand write a cluster.conf as per the documentation. For F17 and above
39*4882a593Smuzhiyuncman has been replaced by the dlm package.
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunGFS2 is not on-disk compatible with previous versions of GFS, but it
42*4882a593Smuzhiyunis pretty close.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunThe following man pages can be found at the URL above:
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun  ============		=============================================
47*4882a593Smuzhiyun  fsck.gfs2		to repair a filesystem
48*4882a593Smuzhiyun  gfs2_grow		to expand a filesystem online
49*4882a593Smuzhiyun  gfs2_jadd		to add journals to a filesystem online
50*4882a593Smuzhiyun  tunegfs2		to manipulate, examine and tune a filesystem
51*4882a593Smuzhiyun  gfs2_convert		to convert a gfs filesystem to gfs2 in-place
52*4882a593Smuzhiyun  mkfs.gfs2		to make a filesystem
53*4882a593Smuzhiyun  ============		=============================================
54