fixed the error when mounting a lvm snapshot in which filesystem inconsistencies exist

when we create a lvm snapshot with mode mysql, as no sync commands will be performed, so probably the filesystem of the lvm snapshot is inconsistant. We need to use mount options ro and norecovery to omit inconsistency errors in filesystem.

Change-Id: I16abcb7f3c828b454495f3dc94b904ca91943aa7
Closes-Bug:1874421
This commit is contained in:
Haosheng He 2020-04-23 23:04:33 +08:00 committed by Haus He
parent 5effc13828
commit 3333855de2
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ def lvm_snap(backup_opt_dict):
filesys_type = get_vol_fs_type(backup_opt_dict.lvm_srcvol)
mount_options = '-o {}'.format(backup_opt_dict.lvm_snapperm)
if 'xfs' == filesys_type:
mount_options = ' -onouuid '
mount_options = ' -onouuid,ro,norecovery '
# Mount the newly created snapshot to dir_mount
abs_snap_name = '/dev/{0}/{1}'.format(
backup_opt_dict.lvm_volgroup,