Leaderboard (728 x 90)

Friday, July 23, 2010

Why might I be receiving errors related to the cluster or filesystem names when I attempt to mount a GFS or GFS2 filesystem?

Problem

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

* Cluster name: This must exactly match the name in use by the cluster at the time of mounting, which can be checked in /etc/cluster/cluster.conf:



* Filesystem name: This 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

These attributes can be specified using the -t option. For example:

# mkfs.gfs -p lock_dlm -t myCluster:datafs1 -j 3 /dev/clustervg/datalv1
# mkfs.gfs2 -p lock_dlm -t myCluster:datafs1 -j 3 /dev/clustervg/datalv1

Where myCluster is the name of the cluster and datafs1 is the name given to this filesystem. If either of these two values is defined incorrectly, it can cause mount attempts to fail with varying error messages depending on the version and specific failure.

Diagnosis

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


Solution

The locking table can be changed using the gfs_tool or gfs2_tool for GFS and GFS2, respectively.



NOTE: Before changing the locking table, ensure that the device in question should in fact be presented to this cluster and is unmounted on all nodes. If a GFS/GFS2 filesystem is being used by one cluster and the device it resides on is accidentally presented to another cluster, changing its locking table can have negative consequences for the cluster that was already using it.

# gfs_tool sb /dev/clustervg/datalv1 table myCluster:datafs1
You shouldn't change any of these values if the filesystem is mounted.

Are you sure? [y/n] y

current lock table name = "otherCluster:otherfs1"
new lock table name = "myCluster:datafs1"

Done


# gfs2_tool sb /dev/clustervg/datalv1 table myCluster:datafs1
You shouldn't change any of these values if the filesystem is mounted.

Are you sure? [y/n] y

current lock table name = "otherCluster:otherfs1"
new lock table name = "myCluster:datafs1"
Done


Further mount requests should no longer fail with the previously mentioned error messages.

Reference: http://kbase.redhat.com/faq/docs/DOC-3773

No comments:

Post a Comment