pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <gsmith@gregsmith.com>
To: pgsql-general@postgresql.org
Subject: Re: full_page_writes = off?
Date: Sun, 2 Dec 2007 15:58:56 -0500 (EST)
Message-ID: <Pine.GSO.4.64.0712021528290.2007@westnet.com> (raw)
In-Reply-To: <20071201121601.GB2552@batory.org.pl>
References: <4751150F.8080604@mail.ru>
	<20071201114754.GA2552@batory.org.pl>
	<47514DDC.70607@marquesminen.com.ar>
	<20071201121601.GB2552@batory.org.pl>

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



view thread (11+ messages)  latest in thread

Message-ID: <Pine.GSO.4.64.0712021528290.2007@westnet.com>
Permalink:  ../Pine.GSO.4.64.0712021528290.2007@westnet.com/
Also on:    postgresql.org/message-id/Pine.GSO.4.64.0712021528290.2007@westnet.com

 · 

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: gsmith@gregsmith.com, pgsql-general@postgresql.org
  Subject: Re: full_page_writes = off?
  In-Reply-To: <Pine.GSO.4.64.0712021528290.2007@westnet.com>

* 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