[Hampshire] Write-caching and journalling filesystems.

Top Page
Author: Hugo Mills
Date:  
To: Hants LUG
Subject: [Hampshire] Write-caching and journalling filesystems.

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x5856b100.hantslug.org.uk.10790': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Wed Jan 16 15:06:16 2008 GMT
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
All -

I turned this up while browsing through today's LKML postings. The
main information is in the XFS FAQ:

http://oss.sgi.com/projects/xfs/faq.html#wcache

The potted summary is: if you have write cache enabled on your hard
disk, then your system may be at risk of data corruption on power
loss.

- If you have write cache enabled on the disk, and write barriers
enabled (see below) on the filesystem, then you are OK.

- If you have write cache enabled on the disk, and battery-backed
cache on the disk, then you are OK.

- If you have write cache disabled on the disk, then you are OK.

- In any other situation, you may be at risk.

Barriers are a filesystem feature which allows the filesystem to
flush the disks write cache to the platter at regular intervals. By
default, XFS and ReiserFS have barriers enabled. *ext3 does not*

So, if you're using ext3, you should do one or other of the
following:

- Disable the write cache on your hard disks (see the link at the top
of this mail for details)

- Add the option "barrier=1" to the mount options on all of your ext3
filesystems. If you do this, you should also check that barriers
are supported on your hardware -- see the "Write barrier support"
subsection in [1] for how to check this (I'm not sure if that
particular piece of advice is XFS-specific, or will work for any
storage device, sorry).

Hugo.

[1] http://oss.sgi.com/projects/xfs/faq.html#wcache_fix

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
  --- What do you give the man who has everything? -- Penicillin is ---  
                             a good start...