Disk write cache is a feature provided by drive vendors to improve the performance of the disks.
This feature can result in data loss if there are sudden power outages.
It depends on the application to decide whether to enable disk write cache or not.
For SATA SSD drives the following commands can be used to enable and disable write caching.
To know write caching is enabled/disabled
hdparm -W /dev/sda
To enable write cache
hdparm -W 1 /dev/sda
To disable write cache
hdparm -W 0 /dev/sda
where, /dev/sda is example SATA SSD used.
You can get the details of the drive susing lsscsi command.
24 years of experience in various layers of software. Primarily experienced in system side software design and development on server management software. Interested in linux development in x86 and arm architecture.