From 0d5deebe11818a54f79ca66e1a1d41dae0e0b52b Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 27 Oct 2010 21:19:11 -0400 Subject: [PATCH] Reorganize OS-specific details about write caching into a list. Along the way, clarify that sdparm can be used on Linux as well as FreeBSD. --- doc/src/sgml/wal.sgml | 71 +++++++++++++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/doc/src/sgml/wal.sgml b/doc/src/sgml/wal.sgml index 7b50bddd04..e7980b386e 100644 --- a/doc/src/sgml/wal.sgml +++ b/doc/src/sgml/wal.sgml @@ -69,26 +69,57 @@ - To check write caching on Linux use - hdparm -I; it is enabled if there is a * next - to Write cache; hdparm -W to turn off - write caching. On FreeBSD use - atacontrol. (For SCSI disks use sdparm - to turn off WCE.) On Solaris the disk - write cache is controlled by format - -e. (The Solaris ZFS file system is safe with - disk write-cache enabled because it issues its own disk cache flush - commands.) On Windows if wal_sync_method - is open_datasync (the default), write caching is disabled - by unchecking My Computer\Open\{select disk - drive}\Properties\Hardware\Properties\Policies\Enable write caching on - the disk. Also on Windows, fsync and - fsync_writethrough never do write caching. The - fsync_writethrough option can also be used to disable - write caching on MacOS X. - + These caches can typically be disabled; however, the method for doing + this varies by operating system and drive type: + + + + + + On Linux, IDE drives can be queried using + hdparm -I; write caching is enabled if there is + a * next to Write cache. hdparm -W + can be used to turn off write caching. SCSI drives can be queried + using sdparm. + for SCSI drives. Use sdparm --get=WCE to check + whether the write cache is enabled and sdparm --clear=WCE + to disable it. + + + + + + On FreeBSD, IDE drives can be queried using + atacontrol, and SCSI drives using + sdparm. + + + + + + On Solaris, the disk write cache is controlled by + format -e. + (The Solaris ZFS file system is safe with disk write-cache + enabled because it issues its own disk cache flush commands.) + + + + + + On Windows, if wal_sync_method is + open_datasync (the default), write caching is disabled + by unchecking My Computer\Open\{select disk drive}\Properties\Hardware\Properties\Policies\Enable write caching on the disk. + Alternatively, set wal_sync_method to fsync or fsync_writethrough, which never do write caching. + + + + + + On MacOS X, write caching can be disabled by + setting wal_sync_method to fsync_writethrough. + + + Many file systems that use write barriers (e.g. ZFS, -- 2.40.0