How to setup GFS on RHEL/CentOS/Fedora

A clustered file system or SAN file system, is an enterprise storage file system which can be shared (concurrently accessed for reading and writing) by multiple computers. Such devices are usually clustered servers, which connect to the underlying block device over an external storage device. Such a device is commonly a storage area network (SAN).
Examples of such file systems:
* GFS : The Red Hat Global File System
* GPFS : IBM General Parallel File System
* QFS : The Sun Quick File System
* OCFS : Oracle cluster file system
In the rest of tutorial we will focus on GFS2 file system the new version of GFS file system, and how to mount a shared disk on a Fedora, Red Hat or CentOS. GFS (Global File System) is a cluster file system. It allows a cluster of computers to simultaneously use a block device that is shared between them (with FC, iSCSI, NBD, etc…). GFS is a free software, distributed under the terms of the GNU General Public License, was originally developed as part of a thesis-project at the University of Minnesota in 1997.
So, let start this brief configuration.Install Clustering Software
Add tools for Cluster and Cluster Storage in RHN to the servers: So on both servers[mezgani@node1 ~]$ sudo yum -y groupinstall Clustering[mezgani@node1 ~]$ sudo yum -y groupinstall “Cluster Storage”[mezgani@node2 ~]$ sudo yum -y groupinstall Clustering[mezgani@node2 ~]$ sudo yum -y groupinstall “Cluster Storage”

luci is started so you can connect to https://node1:8084/ with admin user and password that you’ve set.
Create a new cluster ‘delta’ and add nodes using locally installed files option

Later, you may use parted to manage partitions on sda disk, and create some partitions.
Parted is an industrial-strength package for creating, destroying, resizing, checking and copying partitions, and the file systems on them. It support big partitions unlike fdisk.
For example here i create a partition of 1T.[mezgani@node1 ~]$ sudo parted /dev/sda
GNU Parted 1.8.1
On utilise /dev/sda
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) p

After creating partition, make gfs2 file system on it, with mkfs.gfs2 like this[mezgani@node1 ~]$ sudo /sbin/mkfs.gfs2 -p lock_dlm -t delta:gfs2 -j 8 /dev/sda1
This will destroy any data on /dev/sda1.
It appears to contain a ext3 filesystem.

Nope nope.. Your question is totally valid. However, you, like myself, thought that GFS was a replicating filesystem.. But it’s not. It’s just more lock friendly in different ways. It itself does no means of replication on it’s own. For that you need DRDB or something.

Me I am trying to cluster 3 (potentially more) servers together to share replicated data, live, read/write usable, and there’s apparently no solution for this yet, except Coda, an old friend of mine.

People always keep saying, DRDB with GFS/GFS2, but DRDB only works with 2 nodes. Not 3 or more. So this really hinders things.