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?


    • Official Post

    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.

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

    Edited once, last by Adoby ().

  • HDD spindown is typically controlled by the SATA/USB interface, not by OMV.

    Im using esxi to run omv as vm. Does physical disk properties works?

    Processor: Intel(R) Core(TM) i7-5820k CPU @ 3.30GHz

    RAM: 24GB
    OS: Windows 10 x64
    OMV Virtualized in: Vmware Workstation Pro with 4gb RAM.
    OMV Version 5.6.16-1 (Usul)

    Kernel Linux 5.10.0-0.bpo.8-amd64

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!