^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Linux SCSI Disk Driver (sd) Parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) cache_type (RW)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) ---------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Enable/disable drive write & read cache.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) =========================== === === =========== ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) cache_type string WCE RCD Write cache Read cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) =========================== === === =========== ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) write through 0 0 off on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) none 0 1 off off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) write back 1 0 on on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) write back, no read (daft) 1 1 on off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) =========================== === === =========== ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) To set cache type to "write back" and save this setting to the drive::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) # echo "write back" > cache_type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) To modify the caching mode without making the change persistent, prepend
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) "temporary " to the cache type string. E.g.::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) # echo "temporary write back" > cache_type