home of the madduck/ blog/
XFS -barriers +write-cache considered harmful

If you have an XFS filesystem on hardware without barriers (or with broken barriers as was the case on my X40's Hitachi drive) and with write-caching enabled, disable the latter NOW (the following will work for PATA drives, and SATA if you have a [rd]ecent kernel):

apt-get install hdparm
df -T | egrep ' xfs ' | sed -rne 's,(/dev/[sh]d<span class="createlink"><a href="http://madduck.net/cgi-bin/ikiwiki?page=%3Aalpha%3A&amp;from=blog%2F2006.07.18%3Axfs-caching&amp;do=create" rel="nofollow">?</a>:alpha:</span>).*,\1,p' \
  | sort -u | while read disk; do cat <<_eof
$disk {
  write_cache = off
}
_eof
done >> /etc/hdparm.conf
/etc/init.d/hdparm start

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

Anyway, damage mitigated. xfs_repair -d /dev/md1 feels funny when /dev/md1 is the root partition of your laptop and you're about to move to Ireland for six weeks, fully dependent on that machine.

But yeah, XFS on a laptop is asking for trouble anyway. Call me masochist.

Update: You may also be interested in this post.