Why do I get "fs is for a different cluster" when I attempt to mount a GFS or GFS2 filesystem?

Solution Verified - Updated

Environment

  • Red Hat Cluster Suite 4+ and Red Hat GFS 6.1
  • Red Hat Enterprise Linux Server 5, 6, 7, or 8 (with the Resilient Storage Add-on)
  • A GFS or GFS2 filesystem

Issue

  • How do I change the name of my gfs/gfs2 filesystem?
  • Why do I get this error when trying to mount my gfs/gfs2 filesystem?
# mount -t gfs2 /dev/clust/lv1  /mnt/lv1
fs is for a different cluster
error mounting lockproto lock_dlm
  • I get this error in the logs when trying to mount a gfs/gfs2 filesystem:
gfs_controld join: fs requires cluster="GFSPRD" current="gfsprd"

RHEL7 logs would look similar to

Aug 13 08:13:44 node1.pvt  kernel: GFS2: fsid=RHCluster:gfsfs: Trying to join cluster "lock_dlm", "RHCluster:gfsfs"
Aug 13 08:13:44 node1.pvt kernel: dlm: dlm cluster name RHEL7Clu mismatch RHCluster
Aug 13 08:13:44 node1.pvt kernel: GFS2: fsid=RHCluster:gfsfs: dlm_new_lockspace error -53
Aug 13 08:13:44 node1.pvt Filesystem(gfsclusterfs)[12528]: ERROR: Couldn't mount filesystem /dev/ha_vg/ha_lv on /data

Resolution

You will need to change the name on the filesystem to match that of the cluster. Instructions on how to do that can be found in the following solution:

Do I need to make changes to my GFS/GFS2 file systems when renaming the cluster in RHEL?

Root Cause

When creating a GFS or GFS2 filesystem from the command line with mkfs.gfs or mkfs.gfs2, the user must define the cluster name and a filesystem for the locking table that will be written to the superblock.

The cluster name must exactly match the name in use by the cluster at the time of mounting, which can be checked in /etc/cluster/cluster.conf or /etc/corosync/corosync.conf:

        <cluster alias="myCluster" config_version="1" name="myCluster">
    cluster_name: myCluster

Filesystem name must be a unique name across all GFS/GFS2 filesystems available to the cluster, as two filesystems with the same name cannot be mounted simultaneously.

Diagnostic Steps

Cluster Name Mismatch

If the filesystem was created with a cluster name that does not match the one currently in use, attempting to mount it would produce an error such as this on Red Hat Enterprise Linux 4:

# mount -t gfs /dev/clustervg/datalv1 /mnt/datafs1
mount: permission denied
# tail -n 4 /var/log/messages 
Jun  4 15:43:42 node1.pvt kernel: GFS: Trying to join cluster "lock_dlm", "myCluster:datafs1"
Jun  4 15:43:42 node1.pvt kernel: lock_dlm: cman cluster name "myCluster" does not match file system cluster name "otherCluster"
Jun  4 15:43:42 node1.pvt kernel: lock_dlm: init_cluster error -1
Jun  4 15:43:42 node1.pvt kernel: GFS: can't mount proto = lock_dlm, table = otherCluster:datafs1, hostdata = 

or for a GFS/GFS2 filesystem on Red Hat Enterprise Linux 5:

# mount /dev/clustervg/datalv1 /mnt/datafs1
/sbin/mount.gfs: fs is for a different cluster
/sbin/mount.gfs: error mounting lockproto lock_dlm
# tail -n 1 /var/log/messages
Jun  4 15:58:21 node1.pvt gfs_controld[5832]: mount: fs requires cluster="otherCluster" current="myCluster"

Duplicate Filesystem Name

If trying to mount a GFS filesystem that has a duplicate name compared to another that is already mounted, the error would look like this on Red Hat Enterprise Linux 4

# mount -t gfs /dev/clustervg/datalv1 /mnt/datafs1
mount: File exists
# tail -n 4 /var/log/messages
Jun  4 19:30:22 node1.pvt kernel: GFS: Trying to join cluster "lock_dlm", "myCluster:datafs1"
Jun  4 19:30:22 node1.pvt kernel: dlm: datafs1: lockspace already in use
Jun  4 19:30:22 node1.pvt kernel: lock_dlm: new lockspace error -17
Jun  4 19:30:22 node1.pvt kernel: GFS: can't mount proto = lock_dlm, table = myCluster:datafs1, hostdata = 

Or on Red Hat Enterprise Linux 5 with GFS/GFS2:

# mount /dev/clustervg/datafs1 /mnt/datafs1/
/sbin/mount.gfs: different fs appears to exist with the same name
/sbin/mount.gfs: error mounting lockproto lock_dlm
# tail -n 1 /var/log/messages
Jun  4 16:49:00 node1.pvt gfs_controld[5832]: different fs dev /dev/mapper/clustervg-otherlv with same name
SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.