Is the EXT journaling option "data=writeback" supported in RHEL?
Environment
- Red Hat Enterprise Linux 4
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- EXT3
- EXT4
Issue
- Is the EXT journaling option "data=writeback" supported in RHEL?
# cat /proc/mounts
...
/dev/loop0 /mnt/test ext4 rw,seclabel,relatime,barrier=1,data=writeback 0 0
Resolution
-
Red Hat has only tested the default journaling method of 'ordered'. Other methods are not supported and can result in un-expected outcomes.
-
Removing and re-creating the journal will fall to the default journaling mode of 'ordered'.
-
Or else, change the journaling mode using 'tune2fs'.
# tune2fs -o journal_data_ordered /dev/loop0
Root Cause
- The only supported EXT journaling mode by Red Hat, is 'Ordered'. If any other modes are used, it is suggested to move back to 'Ordered'.
Diagnostic Steps
-
For RHEL6 the data mode used for mounting ext3/ext4 file system can be directly viewed in /proc/mounts, for example:
# grep ext /proc/mounts /dev/mapper/vgext-lvext3 /tmp/ext3 ext3 rw,seclabel,relatime,errors=continue,barrier=1,data=writeback 0 0 /dev/mapper/vgext-lvext4 /tmp/ext4 ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0 -
For RHEL7 the following methods can be used to identify the data mode when mounting a file system:
-
Check the mount information in dmesg log:
# grep EXT /var/log/dmesg ... [ 4.258122] EXT4-fs (sda2): mounting ext3 file system using the ext4 subsystem [ 4.259622] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null) -
The logic of displaying the mode of
dataoption for specific file system is as follows:if (EXT4_MOUNT_DATA_FLAGS & (sbi->s_mount_opt ^ def_mount_opt)) { if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) SEQ_OPTS_PUTS("data=journal"); else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) SEQ_OPTS_PUTS("data=ordered"); else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA) SEQ_OPTS_PUTS("data=writeback"); }First get the default mount options for the specific file system:
# tune2fs -l /dev/mapper/vg_data-lv_ext4 | grep 'mount opt' Default mount options: journal_data_writeback user_xattr aclThen check the mount entry in /proc/mounts for that file system:
# grep vg_data-lv_ext4 /proc/mounts /dev/mapper/vg_data-lv_ext4 /tmp/ext4 ext4 rw,seclabel,relatime 0 0Here, the mount information for that file system doesn't contain the mounting mode for
dataoption. This means the file system is being mounted with its default data mode(the one shown in tune2fs).If we mount the file system with other data mode when running the mount command or via the /etc/fstab:
# mount -t ext4 -o data=journal /dev/mapper/vg_data-lv_ext4 /tmp/ext4/, the data mode will show up:
# grep vg_data-lv_ext4 /proc/mounts /dev/mapper/vg_data-lv_ext4 /tmp/ext4 ext4 rw,seclabel,relatime,nodelalloc,data=journal 0 0The output means the file system is mounted with
data=journaloption instead of its default mount option.
-
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.