Reorganize OS-specific details about write caching into a list.
authorRobert Haas
Thu, 28 Oct 2010 01:19:11 +0000 (21:19 -0400)
committerRobert Haas
Thu, 28 Oct 2010 01:20:58 +0000 (21:20 -0400)
Along the way, clarify that sdparm can be used on Linux as well as FreeBSD.

doc/src/sgml/wal.sgml

index 7b50bddd04c71069a2a128fd72dc4b59f4bc3dae..e7980b386e9920b3c24e018c8683cb8c5b8e245d 100644 (file)
   
 
   
-   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 
-   url="http://sg.danny.cz/sg/sdparm.html">sdparm
-   to turn off WCE.)  On Solaris the disk
-   write cache is controlled by 
-   url="http://www.sun.com/bigadmin/content/submitted/format_utility.jsp">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,