To disable a local disk's write cache, one can use hdparm in the following way:
sudo hdparm -W 0 /dev/sda
(where /dev/sda is the device file of the local disk)
On AWS, I tried to use this to disable the write cache for a local instance store which is an SSD based one. But I am getting the following error:
/dev/xvdc:
HDIO_DRIVE_CMD(identify) failed: Invalid argument
Any guidance on how to disable disk cache of an AWS instance store would be appreciated.