[mythtv-users] EXT4 vs XFS

Daniel Kristjansson danielk at cuymedia.net
Mon Nov 14 18:19:13 UTC 2011


On Sun, 2011-11-13 at 22:03 -0500, Steven Adeff wrote:
> Hey Daniel (or anyone else who knows), could you explain a little more
> about the barrier/nobarrier setting?
> 
> I currently have my root with /etc and /var/log on my backend as an
> ext4 partition and my recording drives as xfs. I'd like to know if I
> should bother to use the nobarrier mount option for my recording
> drives and what I should expect by doing so.
> 
> Also, should bother to "move" my root to ext3 type?

As I understand it with "barrier" Linux waits for all data to be
flushed from all caches when there is a metadata update or an
explicit flush. nobarrier waits for all data to be flushed from
the operating system caches in these cases, but it doesn't wait
for the hard drive caches to be flushed. For recording drives we
are writing so much data that the hard drive caches don't provide
a huge performance benefit, so running with "nobarrier" will only
provide a small performance benefit (maybe 100% faster). Databases,
both ones like mysql and the internal sqlite database in programs
like firefox, do a lot of explicit syncs of small bits of data so
the cache on the hard drive provides a large performance boost in
these cases. Here "nobarrier" provides a large performance benefit
(2000% faster, or better!)

In all cases you will lose data and data integrity if power is cut
abruptly. Barriers don't matter for that. It's just that with barriers
enabled the file system structure itself is more likely to be restored
by just replaying the log (your data will still be lost), without
barriers you are more likely to need to run fsck and there is always
the remote possibility that fsck will not be able to fix the damage
so you lose the whole partition and not just a few open files. With
or without barriers, ext4 and XFS can lose the contents of any open
for writing files because of delayed allocation. The ext3 file system
is unlikely to lose any data other than brand new files and updates to
files. It will not lose existing files unless the hardware itself it
damaged. This is simply because it doesn't do much to optimize disk
layout.

I personally wouldn't bother to change my root partition from ext4 to
ext3, I'd just take the nobarrier risk. But power losses don't happen
often in NYC. I might think differently if I lived in the Congo and
couldn't afford a UPS.

-- Daniel



More information about the mythtv-users mailing list