Additional use case below...
On 09/15/08 23:37, Ben Rockwood wrote:
Will Murnane wrote:
On Tue, Sep 16, 2008 at 01:28, Ben Rockwood <[EMAIL PROTECTED]> wrote:
This is wrong... Ditto blocks are exactly what the name suggests,
duplicate data blocks. If you write 8KB and "copies=2" 16KB is written
to disk.
But by default copies=1, and only one block is written.
Correct.
The primary purpose of ditto blocks is to provide data redundancy when
you do posses multiple disks, for instance on a laptop drive. If one
"do not"?
block becomes corrupt, ditto blocks can provide a duplicate block to
prevent data loss.
Yes, but my understanding is that this isn't a very good method of
providing redundancy; AIUI the two copies aren't guaranteed to be on
different disks, so if that disk dies you've lost all the copies of
that file. Not to mention the pool won't be importable with a missing
disk.
Right. If your using RAIDZ, RAIDZ2 or Mirrors you either have a
redundant block or can reconstruct one... therefore, Ditto Blocks are
really only interesting when you have a single disk.
I'll give you an example. I have Dell 2950's with nice LSI MegaSAS
controllers with 256MB of Battery Backed Cache. I really want to use
that, so I create a single RAID5 in hardware, then I create ZPool on
it. Works well, fast. If there is a disk failure the controller deals
with it, ZFS never knows. HOWEVER, I've have run into corrupt blocks in
files (commonly database data files). UFS/EXT3/etc. wouldn't have even
caught this. The MegaSAS controller isn't aware of it, but ZFS is.
While there are redundant blocks on physical disk, ZFS can't see them
and thus can't recover my block... this is a scenario in which I turned
to Ditto Blocks (copies=2) to protect me.
In this example (this is real) I realized that from the standpoint of
protection, your better off giving the disks directly to ZFS than to put
them behind a hardware RAID. If I'm going to use Ditto Blocks and
consume double the disk, why not just use a mirror? In hardware I know
present 2 RAID1's and mirror those in ZFS so I get write-back caching
AND protection.
Thus, RAIDZ/RAIDZ2 and Ditto Blocks should be considered mutually
exclusive... if you use them together your wasting disk. (If someone
can demonstrate that I'm wrong on this please do so.)
I look at it a little differently. The copies parameter is set per
file system (or zvol,) not per storage pool. Mirroring and raidz[12]
are set per storage pool. This flexibility allows you to set different
policies on a file system than you might on a pool. For example,
my wife's home directory (which contains her pictures) has
copies=2. But the OS on the same storage pool has copies=1
because I can always reload the OS from media, if or when ZFS
complains about corruption in the OS file system. If you have
very important data and are paranoid about losing it, then you
might configure a file system with copies=2 or 3, regardless of
the storage pool configuration. One side affect of this strategy
is that you can't really say, categorically, that copies=2 will
always use 2x the space, especially if you also enable compression...
space accounting just gets... fuzzier... a distant ship's smoke on
the horizon...
-- richard
_______________________________________________
storage-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/storage-discuss