User Tools

Site Tools


aix:concurrent_fs_mount

Prevent concurrent mount of filesystem

Mount Guard

To prevent disk corruption in case of accessing VG from 2 servers without efficient locking, you ca use mount guard. The only exception to this is mounting the filesystem read-only, where files or directories can't be changed.

In AIX 7100-01 and 6100-07 a new feature called “Mount Guard” has been added to prevent simultaneous or concurrent mounts. If a filesystem appears to be mounted on another server, and the feature is enabled, AIX will prevent mounting on any other server.

Mount Guard is not enabled by default, but is configurable by the system administrator. The option is not allowed to be set on base OS filesystems such as /, /usr, /var etc.

Using Mount Guard

To turn on Mount Guard on a filesystem you can permanently enable it via /usr/sbin/chfs:

# chfs -a mountguard=yes /mountpoint
/mountpoint is now guarded against concurrent mounts.

The same option is used with crfs when creating a filesystem.

To turn off mount guard:

# chfs -a mountguard=no /mountpoint
/mountpoint is no longer guarded against concurrent mounts.

To determine the mount guard state of a filesystem:

# lsfs -q /mountpoint
Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting
/dev/fslv34     --         /mountpoint            jfs2  4194304 rw         no   no
  (lv size: 4194304, fs size: 4194304, block size: 4096, sparse files: yes, inline log: no, 
  inline log size: 0, EAformat: v1, Quota: no, DMAPI: no, VIX: yes, EFS: no, ISNAPSHOT: no, 
  MAXEXT: 0, MountGuard: yes)

The /usr/sbin/mount command will not show the mount guard state.

Filesystem Mounting and Mount Guard

When a filesystem is protected against concurrent mounting, and a second mount attempt is made you will see this error:

# mount /mountpoint
mount: /dev/fslv34 on /mountpoint:
Cannot mount guarded filesystem.
The filesystem is potentially mounted on another node

After a system crash the filesystem may still have mount flags enabled and refuse to be mounted. In this case the guard state can be temporarily overridden by the “noguard” option to the mount command:

# mount -o noguard /mountpoint
mount: /dev/fslv34 on /mountpoint:
Mount guard override for filesystem.
The filesystem is potentially mounted on another node.

Check into the VG the mountguard option (on one PV from VG)

# readvgda hdisk14 | more
...
------- LV 3 ------
lvname:         fslv34 
lv_state:       1
flags:          0x21
mirror_policy:  2
num_lps:        1
maxsize:        512
stripe_exp:     0
striping_width: 0
lv_avoid:       0
child_min_num:  0
upperbound:     1024
lv_opt:         0x2
preferred_read: 0
strict:         s
relocatable:    y
interpolicy:    m
intrapolicy:    m
mirror_pool[]:  1 2 0
------ lvcb ------
type:           jfs2
created_time:   Thu Dec  4 09:48:06 2014
modified_time:  Mon Jul  1 10:28:11 2019
mod_machine_id: BF8AAAAC00
label:          /opt/tsm
fs:             vfs=jfs2:log=/dev/loglv01:mount=true:account=false:mountguard=yes
dev_uid:        0
dev_gid:        0
dev_perm:       432
------------------
...

Lock VG

chvg -N option is the one that prevent the varyon of the sharedvg

chvg -N n sharedvg :command to prevent varyon on two servers.
aix/concurrent_fs_mount.txt · Last modified: 2022/11/07 11:02 by manu