ZFS install on a partition

Paul Kraus paul at kraus-haus.org
Sat May 18 13:08:38 UTC 2013


On May 18, 2013, at 12:49 AM, kpneal at pobox.com wrote:

> On Fri, May 17, 2013 at 08:03:30PM -0400, Paul Kraus wrote:
>> On May 17, 2013, at 6:24 PM, "bsd at todoo.biz" <bsd at todoo.biz> wrote:
>>> 3. Should I avoid using ZFS since my system is not well tuned and It would be asking for trouble to use ZFS in these conditions. 
>> 
>> No. One of the biggest benefits of ZFS is the end to end data integrity.
>> IF there is a silent fault in the HW RAID (it happens), ZFS will detect
>> the corrupt data and note it. If you had a mirror or other redundant device,
>> ZFS would then read the data from the *other* copy and rewrite the bad
>> block (or mark that physical block bad and use another).
> 
> I believe the "copies=2" and "copies=3" option exists to enable ZFS to
> self heal despite ZFS not being in charge of RAID. If ZFS only has a single
> LUN to work with, but the copies=2 or more option is set, then if ZFS
> detects an error it can still correct it.

	Yes, but …. What the "copies=<n>" parameter does is tell ZFS to make that many copies of every block written on the top level device. So if you set copies=2 and then write a 2MB file, it will take up 4MB of space since ZFS will keep two copies of it. ZFS will attempt to put them on different devices if it can, but there are no guarantees here. If you have a single vdev stripe and you lose that one device, you *will* lose all your data (assuming you did not have another backup copy someplace else). On the other hand, if the single device develops some bad blocks, with copies=2 you will *probably* not lose data as there will be other copies of those disk blocks elsewhere to recover from.

	From my experience on the ZFS Discuss lists, the place people seem to use copies=<more than 1> are on laptops where they only have one drive and copies=<more than1> is better than no protection at all, it is just not complete protection.

> This option is a dataset option, is inheritable by child datasets, and can
> be changed at any time affecting data written after the change. To get the
> full benefit you'll therefore want to set the option before putting data
> into the relevant dataset.

	You can change it any time and it will only effect data written from that point on. This can be useful if you have both high value data band low value and you can control when each is written. For example, you leave copies=1 for most of the time, then you want to save your wedding photos, so you set copies=3 and write all the wedding photos, you then set copies=1. You will have three copies of the wedding photos and one copy of everything else.

--
Paul Kraus
Deputy Technical Director, LoneStarCon 3
Sound Coordinator, Schenectady Light Opera Company



More information about the freebsd-questions mailing list