How to disable hard disk write cache?

Xin Li delphij at delphij.net
Tue Sep 16 14:09:10 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 9/16/14 5:36 PM, Xu Zhe wrote:
> Hi, all,
> 
> Does anyone knows how to disable write cache of hard disk?
> 
> I have found some hints here at Freebsd website:
> 
> https://www.freebsd.org/doc/handbook/configtuning-disk.html
> 
> However, this seems only work for ATA devices, what about SAS/NLSAS
> devices (Meanwhile, it seems that there is no such sysctl in latest
> Freebsd release, which is 10.0)?
> 
> Any hints are welcomed!

Why do you want to disable write cache in the first place?  It's not
needed for most configurations nowadays.

Modern SATA/SAS/SCSI devices usually comes with the capability of
tagged commands, allowing the OS to know when a write buffer is on
stable storage.  With this, file systems can easily implement the
right semantics and recover from e.g. a power outage, etc.

Cheers,
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJUGESDAAoJEJW2GBstM+ns2R4QAKKL2+TKfTaFQOWk4/jOKzdD
6yANm2ZYI3reChuUmbYjjchfce6nGcxz7EPjTOfBLj37p8bZFaW91e/ayviY9pNL
QktP0hgTZp4EFLJSlPfqjx6f8aU2gJ640b/cKbIQkaxHWRLoHea8GJ2XhyVS9JfK
o8aM+VPyxRrTRH0e2BQ8t0DMJohCrVNZ0fYSAKToDqI2RpcmOumYA4yChXb0hgvc
Rz3PGZth19E4rxdNtOM0Ap/l4PL3+lInIlU8kPdwUaqvT11mxjUM+6zkF904VtqL
5xoURW/j9MAbFl6ozJJKnkfd20lCT3TfyQUC7weDOT8Jz78/8Sx2qy6ilkQCe0ZI
AWV0hpoQPk2bzFxwB7wr9MiVbXJcpAHfHFcKTbLWY4NzY/8RknDt5dNsqsntlDww
dSb1xRLdPQFBh7NrZA1GAfxXdfK8GNBONF+cRKutvFAlIzq0kywaa5baN1ZwLdU2
Kz3LJ0SLQMNEFioES+9j94fSeiW9LY9OJlI9EAjf2gys4WFeLkTgOgdBhvY935Mi
j6FHk4xZmgKOS2s0c7UOYMjj6OgU1or4t2awMF/ObQwd8cmCT5abeGUdtrDGdCZu
am/9nbCfR6FHhm5k90t+yCzl/hPf7dqVoz41bnP6+dD5q5zwxOhOc/SEiCJKCH3L
iQoPiJfxH7JGZdCw/Vz+
=QSHo
-----END PGP SIGNATURE-----


More information about the freebsd-scsi mailing list