linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mdadm vs zfs for home server?
@ 2013-05-27 18:09 Matt Garman
  2013-05-27 19:02 ` Roy Sigurd Karlsbakk
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Matt Garman @ 2013-05-27 18:09 UTC (permalink / raw)
  To: linux-raid


Anyone out there have a home (or maybe small office) file server
that where they thought about native Linux software RAID (mdadm)
versus ZFS on Linux?

I currently have a raid6 array built from five low power (5400 rpm)
3TB drives.  I put an ext4 filesystem right on top of the md device
(no lvm).  This array used to be comprised of 2TB drives; I've been
slowly replacing drives with 3TB versions as they went on sale.

I run a weekly check on the array ("raid-check" script on CentOS,
which is basically a fancy wrapper for "echo check >>
/sys/block/mdX/md/sync_action").  I shouldn't be surprised, but I've
noticed that this check now takes substantially longer (than it did
with the 2TB drives).

I got to thinking about the chances of data loss.  First off: I do
have backups.  But I want to take every "reasonable" precaution
against having to use the backups.  Initially I started thinking
about zfs's raid-z3 (basically, triple-parity raid, the next logical
step in the raid5, raid6 progression).  But then I decided that,
based on the check speed of my current raid6, maybe I want to get
away from parity-based raid all together.

Now I've got another 3TB drive on the way (rounding out the total to
six) and am leaning towards RAID-10.  I don't need the performance,
but it should be more performant than raid6.  And I assume (though I
could be very wrong) that the weekly "check" action ought to be much
faster than it is with raid6.  Is this correct?

But after all that zfs reading, I'm wondering if that might not be
the way to go.  I don't know how necessary it is, but I like the
idea of having the in-filesystem checksums to prevent "silent" data
corruption.

I went through a zfs tutorial, building a little raid10 pool out of
files (just to play with).  Seems pretty straightforward.  But I'm
still much more familiar with mdadm (not an expert by any means, but
quite comfortable with typical uses).  So, does my lack of
experience with zfs offset it's data integrity checks?  And
furthermore, zfs on linux has only recently been marked stable.
Although there is plenty of anecdotal comments that it's been stable
much longer (the zfs on linux guys are just ultra-conservative).
Still, doesn't mdadm have the considerable edge in terms of
"longtime stability"?

As I said initially, I'm in the thinking-it-through stage, just
looking to maybe get a discussion going as to why I should go one
way or the other.

Thanks,
Matt


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: mdadm vs zfs for home server?
@ 2013-05-28  3:09 Ryan Wagoner
  0 siblings, 0 replies; 11+ messages in thread
From: Ryan Wagoner @ 2013-05-28  3:09 UTC (permalink / raw)
  To: Matt Garman; +Cc: linux-raid

On Mon, May 27, 2013 at 2:09 PM, Matt Garman <matthew.garman@gmail.com> wrote:
>
>
> Anyone out there have a home (or maybe small office) file server
> that where they thought about native Linux software RAID (mdadm)
> versus ZFS on Linux?
>


I have a 4 x 1TB drive setup that was running CentOS 5 with mdadm and
ext4 for the last 4 years. About 3 weeks ago I reinstalled with CentOS
6 and ZFS on Linux. One of the deciding factors was I wanted the
previous version tab in Windows to function since I access the shares
mainly from Windows systems.

I've looked at LVM solutions in the past, but there were multiple
drawbacks. The recent LVM thin provisioning addresses some of the
issues, but it still was cumbersome and drawn out dealing with the
various layers.

I also looked at Solaris (OpenIndiana and OmniOS) and FreeBSD.
Obviously ZFS on Solaris just works and the performance seemed good.
However I'm not as familiar with Solaris and there isn't a large
community following for support. FreeBSD had terrible performance out
of the box accessing the Samba shares. I would see spikes where I
would get 70% of gigabit and then drop to 30% and back again. FreeBSD
seems to always require tweaking for performance, which seems
unnecessary when Linux has good performance out of the box.

Going back to CentOS 6 I followed the http://zfsonlinux.org/
directions and was up and running in minutes. Performance with Samba
was great and the system has been rock solid. Accessing shares from
Windows I can achieve 80-90% of gigabit. With ext4 I would see 90-100%
utilization on a large copy, but the features are worth the small
performance hit.

I did turn compression on and atime off. I also set the recommended
options for interoperability with Windows when creating the datasets.

zfs set compress=on data
zfs set atime=off data

zfs create -o casesensitivity=mixed -o nbmand=on data/share

I am using the https://github.com/zfsonlinux/zfs-auto-snapshot script
to create daily and weekly snapshots. You can disable snapshots per
zfs dataset with

zfs set com.sun:auto-snapshot=false data/share2

With CentOS 6.4 Samba 3.6.9 has support for the format option of the
vfs shadow_copy2 module. I added the following to /etc/samba/smb.conf
and the previous versions tab populated.

unix extensions = no

[share]
path = /data/share
wide links = yes
vfs objects = shadow_copy2
shadow: snapdir = .zfs/snapshot
shadow: format = zfs-auto-snap_daily-%Y-%m-%d-%H%M

I added a cron.d job to weekly scrub the array like the raid-check script does.

# Run system wide zfs scrub once a week on Sunday at 3am by default
0 3 * * Sun root /usr/local/sbin/zfs-scrub

Contents of the /usr/local/sbin/zfs-scrub file.

#!/bin/sh
for pool in `/sbin/zpool list -H | cut -f 1`
do
   /sbin/zpool scrub $pool
done

The only missing part is a script to check the zpool status command
for errors and send an email alert.

Ryan

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-05-28 15:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-27 18:09 mdadm vs zfs for home server? Matt Garman
2013-05-27 19:02 ` Roy Sigurd Karlsbakk
2013-05-28 15:00   ` Matt Garman
2013-05-28 15:18     ` Jon Nelson
2013-05-27 19:20 ` Roman Mamedov
2013-05-27 22:33 ` Stan Hoeppner
2013-05-27 23:50   ` Phil Turmel
2013-05-28  5:12     ` Stan Hoeppner
2013-05-28 15:24   ` Matt Garman
2013-05-28 15:55     ` Ryan Wagoner
  -- strict thread matches above, loose matches on Subject: below --
2013-05-28  3:09 Ryan Wagoner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).