- Disabling the write back cache.
- For SATA/PATA(IDE):
- (although for SATA this only works on a recent kernel with ATA command passthrough):
- # hdparm -W0 /dev/sda
- # hdparm -W0 /dev/hda
- # blktool /dev/sda wcache off
- # blktool /dev/hda wcache off
- For SCSI:
- Using sginfo(8) which is a little tedious
- It takes 3 steps. For example:
- #sginfo -c /dev/sda
- which gives a list of attribute names and values
- #sginfo -cX /dev/sda
- which gives an array of cache values which you must match up with from step 1, e.g.
- 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0
- #sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0
- allows you to reset the value of the cache attributes.
- This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA
- disk this needs to be done after every reset as it will reset back to the
- default of the write cache enabled. And a reset can happen after reboot or on
- error recovery of the drive. This makes it rather difficult to guarantee that
- the write cache is maintained as disabled.
Raw Paste