Show Table of Contents
22.2. Enabling/Disabling Write Barriers
To mitigate the risk of data corruption during power loss, some storage devices use battery-backed write caches. Generally, high-end arrays and some hardware controllers use battery-backed write caches. However, because the cache's volatility is not visible to the kernel, Red Hat Enterprise Linux 6 enables write barriers by default on all supported journaling file systems.
For devices with non-volatile, battery-backed write caches and those with write-caching disabled, you can safely disable write barriers at mount time using the
-o nobarrier
option for mount
. However, some devices do not support write barriers; such devices will log an error message to /var/log/messages
(refer to Table 22.1, “Write barrier error messages per file system”).
Table 22.1. Write barrier error messages per file system
File System | Error Message |
---|---|
ext3/ext4 | JBD: barrier-based sync failed on device - disabling barriers |
XFS | Filesystem device - Disabling barriers, trial barrier write failed |
btrfs | btrfs: disabling barriers on dev device |
Note
The use of
nobarrier
is no longer recommended in Red Hat Enterprise Linux 6 as the negative performance impact of write barriers is negligible (approximately 3%). The benefits of write barriers typically outweigh the performance benefits of disabling them. Additionally, the nobarrier
option should never be used on storage configured on virtual machines.
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.