Write cache, is write cache, is write cache?

Karl Pielorz kpielorz_lst at tdx.co.uk
Mon Jan 24 14:57:44 UTC 2011


--On 23 January 2011 22:16 +0000 Bruce Cran <bruce at cran.org.uk> wrote:

> You might also find http://brad.livejournal.com/2116715.html
> interesting.

Ok, the utility provided via the Blog reports zero errors when run from 
both UFS, and ZFS with the BIOS set to 'Enabled drive write cache: No'.

Flip the BIOS to 'Yes' - for UFS, things get messy (as you'd kind of 
expect) - the file system gets trashed (enough that autoboot / background 
checking fails), and you can't complete the test because the test file 
doesn't exist after reboot (side effect of softupdates I'd guess).

For ZFS the test still completes - with 'zero errors'. Checking via 
'camcontrol' - the BIOS option 'Enabled drive write cache' just seems to 
affect the 'Write cache enable' features on the drive, i.e.

"
test# camcontrol identify ada0 | grep -E "(Feature)|(cache)"
Feature                      Support  Enabled   Value           Vendor
write cache                    yes      no
flush cache                    yes      yes
"

And with it set to 'Yes' in the BIOS:

"
test# camcontrol identify ada0 | grep -E "(Feature)|(cache)"
Feature                      Support  Enabled   Value           Vendor
write cache                    yes      yes
flush cache                    yes      yes
"


So in a very round-the-houses way, that's all it appears to change... Guess 
it's nice to have the option.

I'd also guess whilst enabling it for ZFS is good, having it enabled for 
UFS is slightly dangerous (and that by enabling it machine wide you may 
trash the UFS file systems on that machine if it suffers a catastrophic 
power outage).


-Karl



More information about the freebsd-fs mailing list