o2cluster is used to change the cluster stack stamped on an OCFS2 file system. It also used to list the active cluster stack and the one stamped on-disk. This utility does not expect the cluster to be online. It only updates the file system if it is reasonably assured that it is not in-use on any other node. Clean journals implies the file system is not in-use. This utility aborts if it detects even one dirty journal.
Before using this utility, the user should use other means to ensure that the volume is not in-use, and more importantly, not about to be put in-use. While clean journals implies the file system is not in-use, there is a tiny window after the check and before the update during which another node could mount the file system using the older cluster stack.
If a dirty journal is detected, it implies one of two scenarios. Either the file system is mounted on another node, or, the last node to have it mounted, crashed. There is no way, short of joining the cluster, that the utility can use to differentiate between the two. Considering this utility is targeted to be used in scenarios when the user is looking to change the on-disk cluster stack, it becomes a chicken-and-egg problem.
If one were to run into this scenario, the user should manually re-confirm that the file system is not in-use on another node and then run fsck.ocfs2(8). It will update the on-disk cluster stack to the active cluster stack, and, do a complete file system check.
The cluster stack can be specified in one of two forms. The first as default, denoting the original classic o2cb cluster stack with local heartbeat. The second as a triplet with the stack name, the cluster name and the cluster flags separated by commas. Like o2cb,mycluster,global.
The valid stack names are o2cb, pcmk, and cman.
The cluster name can be up to 16 characters. The o2cb stack further restricts the names to contain only alphanumeric characters.
The valid flags for the o2cb stack are local and global, denoting the two heartbeat modes. The only valid flag for the other stacks is none.
# o2cluster -r o2cb,myactivecluster,global # o2cluster -o /dev/sda1 o2cb,mycluster,global # o2cluster --update=o2cb,yourcluster,global /dev/sdb1 Changing the clusterstack from o2cb,mycluster,global to o2cb,yourcluster,global. Continue? y Updated successfully.