System information
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 no barri er option for mo unt.
However, some devices do not support write barriers; such devices will log an error message to
/var/l o g /messag es (refer to Table 22.1, “Write barrier error messages per file system” ).
T able 22.1. Writ e barrier erro r messages p er f ile syst em
File Syst em Error Messag e
ext3/ext4 JBD : barri er-based sync fai led o n
device - d i sabl i ng barri ers
XFS Fi l esystem device - D i sabl i ng
barri ers, tri al barri er wri te fai l ed
btrfs btrfs: d i sabl i ng barri ers o n d ev
device
Note
The use of no barri er 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
no barri er option should never be used on storage configured on virtual machines.
22.3. Writ e Barrier Considerat ions
Some system configurations do not need write barriers to protect data. In most cases, other methods
are preferable to write barriers, since enabling write barriers causes a significant performance
penalty.
Disabling Write Caches
One way to alternatively avoid data integrity issues is to ensure that no write caches lose data on
power failures. When possible, the best way to configure this is to simply disable the write cache. On
a simple server or desktop with one or more SATA drives (off a local SATA controller Intel AHCI part),
you can disable the write cache on the target SATA drives with the hd parm command, as in:
# hdparm -W0 /device/
Battery-Backed Write Caches
Write barriers are also unnecessary whenever the system uses hardware RAID controllers with
battery-backed write cache. If the system is equipped with such controllers and if its component
drives have write caches disabled, the controller will advertise itself as a write-through cache; this will
inform the kernel that the write cache data will survive a power loss.
Red Hat Ent erprise Lin ux 6 St orage Admin ist rat io n G uide
156