pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Greg Smith <gsmith@gregsmith.com>
Cc: PostgreSQL-documentation <pgsql-docs@postgresql.org>
Subject: Re: [GENERAL] full_page_writes = off?
Date: Mon, 10 Dec 2007 09:06:26 -0500 (EST)
Message-ID: <200712101406.lBAE6QU19627@momjian.us> (raw)
In-Reply-To: <Pine.GSO.4.64.0712021528290.2007@westnet.com>


I thought we had the disk write cache control documented for popular
operating systems, but I see we don't so I added the following patch to
our documentation.

---------------------------------------------------------------------------

Greg Smith wrote:
> On Sat, 1 Dec 2007, Tomasz Ostrowski wrote:
> 
> > You can also use "hdparm -I" to check this - look for a "Write
> > caching" in "Commands/features" section. If it has a "*" in front
> > then it is enabled and dangerous.
> 
> Right; using -I works with most Linux hdparm versions:
> 
> # hdparm -V
> hdparm v6.6
> # hdparm -I /dev/hda | grep "Write cache"
>             *    Write cache
> # hdparm -W 0 /dev/hda
> 
> /dev/hda:
>   setting drive write-caching to 0 (off)
> # hdparm -I /dev/hda | grep "Write cache"
>                  Write cache
> 
> While being able to check the state with -W only works in very recent 
> ones.
> 
> The best way to make this change permanent varies depending on your Linux 
> distribution.
> 
> Also:  nowadays many SATA disks appear as SCSI devices like /dev/sda.  In 
> some cases I believe you can use a recent hdparm on them anyway, in others 
> I've had to use sdparm instead.  Several of the examples at 
> http://sg.torque.net/sg/sdparm.html show how to manipulate the Write Cache 
> Enabled (WCE) status similarly to the above on SCSI devices.
> 
> > I don't know how to check it on BSD.
> 
> In FreeBSD I believe you use atacontrol to check the settings, and you can 
> make the changes permanent by fiddling with the /boot/device.hints file.
> 
> --
> * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>                http://archives.postgresql.org/

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Attachments:

/rtmp/diff (text/x-diff, 1.5K) download Index: doc/src/sgml/wal.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v retrieving revision 1.46 diff -c -c -r1.46 wal.sgml *** doc/src/sgml/wal.sgml 28 Nov 2007 15:42:31 -0000 1.46 --- doc/src/sgml/wal.sgml 10 Dec 2007 14:04:12 -0000 *************** *** 58,65 **** while some are write-back, and the same concerns about data loss exist for write-back drive caches as exist for disk controller caches. Consumer-grade IDE drives are ! particularly likely to contain write-back caches that will not ! survive a power failure. </para> <para> --- 58,74 ---- while some are write-back, and the same concerns about data loss exist for write-back drive caches as exist for disk controller caches. Consumer-grade IDE drives are ! particularly likely to have write-back caches that will not survive a ! power failure. To check write caching on <productname>Linux</> use ! <command>hdparm -I</>; it is enabled if there is a <literal>*</> next ! to <literal>Write cache</>. <command>hdparm -W</> can to turn off ! write caching. On <productname>FreeBSD</> use ! <application>atacontrol</>. (For SCSI disks use <ulink ! url="http://sg.torque.net/sg/sdparm.html"><application>sdparm</></ulink> ! to turn off <literal>WCE</>.) On <productname>Windows</> write caching is ! controlled by <literal>My Computer\Open\{select disk ! drive}\Properties\Hardware\Properties\Policies\Enable write caching on ! the disk</>. </para> <para>

view thread (11+ messages)  latest in thread

Message-ID: <200712101406.lBAE6QU19627@momjian.us>
Permalink:  ../200712101406.lBAE6QU19627@momjian.us/
Also on:    postgresql.org/message-id/200712101406.lBAE6QU19627@momjian.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us, gsmith@gregsmith.com
  Subject: Re: [GENERAL] full_page_writes = off?
  In-Reply-To: <200712101406.lBAE6QU19627@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox