copies=1 | 2 | 3 (ZFS dataset property)

Moderators: jhartley, MSR734, nola

copies=1 | 2 | 3 (ZFS dataset property)

Post by grahamperrin » Mon Oct 29, 2012 2:01 pm

The copies property works as expected.

If copies is set to 2 or 3, some features of OS X can not work as expected.

Example: if copies=2 at a dataset where Time Machine regularly writes to a .sparsebundle then eventually, Time Machine will cease to backup to that destination (unexpected lack of free space). I gave feedback to Apple a few weeks ago:

  • if copies=2 or copies=3 for a ZFS dataset used by Time Machine, the OS must at least double the space required before copying data
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: copies=1 | 2 | 3 (ZFS dataset property)

Post by grahamperrin » Mon Oct 29, 2012 2:17 pm

At http://www.wuala.com/grahamperrin/publi ... de=gallery two files prove that repairs may be made with a single-disk dataset:

  • 2012-09-23 11-13 repaired, no errors.txt
  • 2012-09-26 12-39 repaired, no errors.txt

Increasing the number of copies, on a single disk, should not be viewed as a substitute for a backup strategy that involves multiple devices.

An earlier file from the same collection –

  • 2012-09-22 08-05 overview of blocky-OS.txt

– proves that after repair, permanent errors may remain. Highlight:

Code: Select all
sh-3.2$ sudo zpool status -xv -T d
Sat 22 Sep 07:56:58 2012
  pool: blocky-OS
 state: ONLINE
status: One or more devices has experienced an error resulting in data
   corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
   entire pool from backup.
 scan: scrub repaired 1.62Mi in 5h22m with 50 errors on Sat Sep 22 07:06:38 2012
config:

   NAME                                         STATE     READ WRITE CKSUM
   blocky-OS                                    ONLINE       0     0    50
     GPTE_31EC193D-5063-4C3C-A3F4-B09A8CBB3C6D  ONLINE       0     0   217  at disk5s2
     GPTE_EF222F60-36F0-4B9C-86C1-0FB57C2000BE  ONLINE       0     0     0  at disk8s1

errors: Permanent errors have been detected in the following files:

        blocky-OS:/macbookpro08-centrim.sparsebundle/bands/6cce
        blocky-OS:/macbookpro08-centrim.sparsebundle/bands/6ccf
sh-3.2$ clear
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

copies=2 versus a sparse bundle disk image

Post by grahamperrin » Tue Oct 30, 2012 12:37 am

Example: if copies=2 at a dataset where Time Machine regularly writes to a .sparsebundle then eventually, Time Machine will cease to backup to that destination (unexpected lack of free space) …


… and if you're unlucky, a zero bytes free incident may leave a sparse bundle disk image unusable. From September 2012, with a past version of ZEVO:


In my case it seems that within the .sparsbundle the Info.plist was damaged or inconsistent. To resolve the issue, I:

  1. removed the offending Info.plist
  2. put in its place a copy of Info.bckup
  3. renamed the copy to Info.plist

– then the disk image became usable.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

copies=3 and RAID-Z1

Post by grahamperrin » Tue Oct 30, 2012 3:09 pm

Re viewtopic.php?p=1287#p1287

As I understand it …

If the state of a three-disk RAID-Z1 pool becomes UNAVAIL with insufficient replicas, and if a dataset in that pool always had copies=3 :

  1. the one remaining disk might (should?) include one copy of each block of the dataset
  2. import would be impossible

– the overriding effect of (b) would make it extraordinarily difficult to access the directories, files and metadata in a user-friendly way. I might think of part of the one remaining disk as all files without a file system.

In this situation I guess that an expert might make some use of zdb, but I shouldn't expect easy or complete recovery of data.

In a nutshell:

  • copies=3 at the dataset level should not be viewed as a fallback where there's risk of insufficient replicas at the pool level.

Further reading/discussion

Unrelated to the copies property: RAID-Z on-disk format

Relating to copies: Ditto Blocks - The Amazing Tape Repellent (Flippin' off bits) (2006-05-12) – an old post, but it helped me to visualise ZFS allocation for ditto blocks.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

If a file is not removable, you might overwrite

Post by grahamperrin » Sat Feb 09, 2013 8:51 pm

If with copies=2 or copies=3 you find yourself with a full volume, from which no file is removable:

  • you may work around by overwriting an unwanted file with zero bytes.

Unable to delete files with full disk quota - Known Issues - HPCC Wiki (2012-08-01), referred from https://groups.google.com/d/msg/zfs-mac ... XjXvu_ajcJ

If (as above) a file system is almost completely monopolised by a sparse bundle disk image, then very few files will be suitable for the workaround. You can't simply zero-out an 8 MB band, and so on. So it's important to avoid monopolies.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom


Return to General Discussion

Who is online

Users browsing this forum: Bing [Bot], ilovezfs and 1 guest