Mounting OCFS2 Volumes….

Use the mount and umount commands to mount and unmount an OCFS2 volume, as you would with any other type of file system. The following example creates a mount point and then mounts the OCFS2 volume by label:

# mkdir /u01

# mount –L myvolume /u01

There is a delay in the clustered mount operation because it must wait for the node to join the DLM domain. A clustered unmount is also not instantaneous, because it involves migrating all mastered lock-resources to the other nodes in the cluster. If the mount fails, use the dmesg command to view error messages.

The cluster stack must be online for the mount to succeed. Check the status of the cluster stack with the following status command. Use the online command to bring the cluster stack online if necessary.

# /sbin/o2cb.init status

# /sbin/o2cb.init online <cluster_name>

To auto-mount volumes on startup, create entries in the /etc/fstab file and configure the ocfs2 initialization service to start at boot time. The ocfs2 service runs after the o2cb service starts the cluster. The ocfs2 service mounts all OCFS2 volumes listed in /etc/fstab. Configure both services to start at boot time as follows:

# systemctl enable o2cb

# systemctl enable ocfs2

OCFS2 supports many of the mount command options supported by other Linux file systems. The following option is required when creating OCFS2 volume entries in /etc/fstab:

  • _netdev – Specifies that the file system resides on a device that requires network access. This prevents the system from attempting to mount these file systems until the network has been enabled. The mount.ocfs2 command transparently appends this option during mount. You must, however, explicitly specify this option in /etc/fstab

The following example specifies the _netdev option in /etc/fstab to mount the OCFS2 volume at boot time:

/dev/xvdf1 /u01 ocfs2 _netdev,defaults 0 0

Use the following mount options when using OCFS2 volumes for Oracle data files, control files, redo logs, voting file, and the Oracle Cluster Registry (OCR):

  • noatime – Disables unnecessary updates to access time (atime) on inodes
  • nointr – Disables signals from interrupting I/Os in progress. This mount option is enabled by default, starting with OCFS2 Release 1.6.

The following example is an entry in /etc/fstab for an OCFS2 volume that hosts Oracle database files:

/dev/xvdf1 /u01 ocfs2 noatime,nointr 0 0

The o2net process handles network communication for all mounts. It gets the list of active nodes from O2HB and sets up a TCP/IP communication channel with each live node. It sends regular keepalive packets to detect any interruption on the channels.

In the following example, the mount command fails and produces an error message:

# mount –L myvolume /u01

mount.ocfs2: Invalid argument while mounting /dev/xvdf1 on /u01. Check ‘dmesg’ for more information on this error.

Using the dmesg command to display more information provides the following message:

o2net: Connection to node host01 (num 0) at 192.168.1.101:7777 shutdown, state 7

The cause of this error is the inability of the nodes to communicate over the network on port 7777. Stop the firewalld service or trust port 7777 to fix this problem.