Write cache: on or off?

    • OMV 4.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Write cache: on or off?

      Hi everyone,
      I am using a Raspberry Pi 4 with 4 USB3 disk connected (1 of which SSD).
      I am noticing on all disk I have the "Write Cache" option off.

      Can you tell me if I should turn it on? what are pros/cons?
      The GUI tells me that this option is activated only if the disk supports it.. is there a way to verify which of my disks support it?

      Thanks!
    • I suspect the write cache actually is turned on, but OMV can't correctly detect it through the USB/SATA interface.

      You can test my suspicion by closely examining the S.M.A.R.T values reported for the HDD. I believe the write cache status is (correctly) reported there.

      Performance is improved by having the write cache turned on. Then writes, especially random writes, can be queued, merged and ordered in a way that makes throughput when writing to disk improved. But latency when writing is increased.

      Security is improved by having the write cache turned off. Then the likelihood of writes corrupting the filesystem if there is a power failure is reduced. But performance is slightly reduced.

      In a RAID system performance can be greatly improved by turning on the write cache. And security improved by using a UPS.

      In practice, if you use a journaling filesystem like EXT4, and stay away from RAID, you should be safe with write cache on even if you don't have an UPS.

      I would recommend you to not touch the settings for the write cache. i suspect it is on, but since there is a USB/SATA interface between the RPi and the HDD it is not correctly reported. If you try to change it things might break.

      Actually I would recommend you to not touch ANY settings for the HDD in OMV if you are using a USB connected HDD. You may break things and the benefits you might get are not very big. HDD spindown is typically controlled by the SATA/USB interface, not by OMV. Carefully read the documentation for the USB/SATA interface.

      But feel free to experiment. But also be aware that things may not work as you think they should through a USB/SATA interface. Especially after a reboot. And make sure to backup your system and data before testing anything! Just because something is there to be changed or experimented with doesn't mean that it is safe to do so, just for fun or curiosity.
      OMV 4: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

      The post was edited 1 time, last by Adoby ().