Time Machine backups to ZFS

Moderators: jhartley, MSR734, nola

Time Machine backups to ZFS

Post by grahamperrin » Thu Sep 20, 2012 3:18 pm

With ZEVO on Mountain Lion, and with a ZFS file system to be used by Time Machine:

  • the OS will automatically create the necessary sparse bundle disk image.

With ZEVO on lesser versions of the OS:


Edge case

If the ZFS dataset has no snapshots and is used for nothing other than Time Machine, and if its free space drops to (or near) zero: the disk image may become unrecognisable.

To minimise the impact, or reduce the risk, approaches include:

  1. have at least one snapshot of the dataset, at a point in time when the disk image is good
  2. without snapshots, alongside the disk image have a disposable file of a reasonable size – if free space drops to zero, removing this file might yield enough free space to avoid a problem with the image.

Defocusing from ZFS: if a sparse bundle disk image becomes unrecognisable following a lack of free space on the underlying file system – if its Info.plist is zero bytes – then Info.bckup may be used for repair. Example:

Code: Select all
macbookpro08-centrim:~ gjp22$ sudo hdiutil imageinfo -debug /Volumes/blocky-OS/macbookpro08-centrim.sparsebundle
DIIsInitialized: returning YES
DIIsInitialized: returning YES
DIBackingStoreNewWithCFURL: entry with
file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
writeable: false
DIBackingStoreInstantiatorProbe: entry
file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
writeable: false
DIBackingStoreInstantiatorProbe: probing interface 0 CBSDBackingStore
CBSDBackingStore::newProbe directory, not a valid image file.
CBSDBackingStore::newProbe score -1000 for file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
DIBackingStoreInstantiatorProbe: interface  0, score    -1000, CBSDBackingStore
DIBackingStoreInstantiatorProbe: probing interface 1 CBundleBackingStore
CBundleBackingStore::newProbe: got bundle
CFBundle 0x7fd8794287a0 </Volumes/blocky-OS/macbookpro08-centrim.sparsebundle> (not loaded)
CFBundleRawInfoPlistURL: Info.plist -- file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
CBundleBackingStore::newProbe score -1000 for file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
DIBackingStoreInstantiatorProbe: interface  1, score    -1000, CBundleBackingStore
DIBackingStoreInstantiatorProbe: probing interface 2 CRAMBackingStore
CRAMBackingStore::probe: scheme "file": not ram: or ramdisk: scheme.
CRAMBackingStore::probe: score -1000 for file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
DIBackingStoreInstantiatorProbe: interface  2, score    -1000, CRAMBackingStore
DIBackingStoreInstantiatorProbe: probing interface 3 CCarbonBackingStore
CCarbonBackingStore::newProbe score -1000 for file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
DIBackingStoreInstantiatorProbe: interface  3, score    -1000, CCarbonBackingStore
DIBackingStoreInstantiatorProbe: probing interface 4 CDevBackingStore
CDevBackingStore::newProbe: not /dev/disk or /dev/rdisk (/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle).CDevBackingStore::newProbe score -1000 for file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
DIBackingStoreInstantiatorProbe: interface  4, score    -1000, CDevBackingStore
DIBackingStoreInstantiatorProbe: probing interface 5 CCURLBackingStore
CCURLBackingStore::probe: scheme is: file
CCURLBackingStore::probe: not recognized URL scheme.
CCURLBackingStore::probe: score -1000 for file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
DIBackingStoreInstantiatorProbe: interface  5, score    -1000, CCURLBackingStore
DIBackingStoreInstantiatorProbe: probing interface 6 CVectoredBackingStore
CVectoredBackingStore::newProbe not "vectored" scheme.
CVectoredBackingStore::newProbe score -1000 for file://localhost/Volumes/blocky-OS/macbookpro08-centrim.sparsebundle/
DIBackingStoreInstantiatorProbe: interface  6, score    -1000, CVectoredBackingStore
DIBackingStoreInstantiatorProbe: nothing to select.
DIBackingStoreNewWithCFURL: probe fails to find appropriate CBackingStore class.
DIBackingStoreNewWithCFURL: returning 110
DIResolveURLToBackingStore: unable to resolve to any backing store class. 110.
DIResolveURLToDiskImage: resolving backing store/file encoding failed. 110.
hdiutil: imageinfo failed - not recognized
macbookpro08-centrim:~ gjp22$ sudo ls -al /Volumes/blocky-OS/macbookpro08-centrim.sparsebundle
total 8051
drwx------@ 3 root   staff     10  6 Sep 08:07 .
drwxr-xr-x  7 gjp22  staff      7  6 Sep 07:28 ..
-rw-r--r--  1 root   staff    499  1 Sep 07:08 Info.bckup
-rw-r--r--  1 root   staff      0  1 Sep 07:08 Info.plist
drwx------  2 root   staff  33772  1 Sep 09:16 bands
-rw-r--r--  1 root   staff    445  6 Sep 08:07 com.apple.TimeMachine.MachineID.bckup
-rw-r--r--  1 root   staff    445  6 Sep 08:07 com.apple.TimeMachine.MachineID.plist
-rw-------  1 root   staff   1519 29 Aug 21:32 com.apple.TimeMachine.Results.plist
-rw-------  1 root   staff    708  1 Sep 07:08 com.apple.TimeMachine.SnapshotHistory.plist
-rwx------  1 root   staff      0 22 Aug 20:30 token
macbookpro08-centrim:~ gjp22$ cd /Volumes/blocky-OS
macbookpro08-centrim:blocky-OS gjp22$ clear





macbookpro08-centrim:blocky-OS gjp22$ sudo mv macbookpro08-centrim.sparsebundle/Info.plist macbookpro08-centrim.sparsebundle/Info.zero
macbookpro08-centrim:blocky-OS gjp22$ sudo cp macbookpro08-centrim.sparsebundle/Info.bckup macbookpro08-centrim.sparsebundle/Info.plist
macbookpro08-centrim:blocky-OS gjp22$ sudo hdiutil attach macbookpro08-centrim.sparsebundle
/dev/disk10            GUID_partition_scheme             
/dev/disk10s1          EFI                               
/dev/disk10s2          Apple_HFS                         /Volumes/Time Machine Backups
macbookpro08-centrim:blocky-OS gjp22$ sudo rm macbookpro08-centrim.sparsebundle/Info.zero
macbookpro08-centrim:blocky-OS gjp22$ clear





macbookpro08-centrim:blocky-OS gjp22$ sudo /sbin/fsck_hfs -l /dev/disk10s2

/dev/rdisk10s2: fsck_hfs run at Thu Sep 20 20:23:43 2012
** /dev/rdisk10s2 (NO WRITE)
   Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.
   Executing fsck_hfs (version diskdev_cmds-557.3~1).
** Performing live verification.
** Checking Journaled HFS Plus volume.
** Detected a case-sensitive volume.
   The volume name is Time Machine Backups
** Checking extents overflow file.
** Checking catalog file.
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking multi-linked directories.
** Checking volume bitmap.
** Checking volume information.
** The volume Time Machine Backups appears to be OK.
macbookpro08-centrim:blocky-OS gjp22$ date
Thu 20 Sep 2012 20:45:36 BST
macbookpro08-centrim:blocky-OS gjp22$ clear





macbookpro08-centrim:blocky-OS gjp22$ hdiutil info
framework       : 344
driver          : 10.7v344
================================================
image-path      : /Volumes/blocky-OS/macbookpro08-centrim.sparsebundle
image-alias     : /Volumes/blocky-OS/macbookpro08-centrim.sparsebundle
shadow-path     : <none>
icon-path       : /System/Library/PrivateFrameworks/DiskImages.framework/Resources/CDiskImage.icns
image-type      : sparse bundle disk image
system-image    : false
blockcount      : 958329724
blocksize       : 512
writeable       : TRUE
autodiskmount   : TRUE
removable       : TRUE
image-encrypted : false
mounting user   : root
mounting mode   : <unknown>
process ID      : 1832
/dev/disk10   GUID_partition_scheme   
/dev/disk10s1   C12A7328-F81F-11D2-BA4B-00A0C93EC93B   
/dev/disk10s2   48465300-0000-11AA-AA11-00306543ECAC   /Volumes/Time Machine Backups
macbookpro08-centrim:blocky-OS gjp22$ clear





macbookpro08-centrim:blocky-OS gjp22$ diskutil info /dev/disk10s2
   Device Identifier:        disk10s2
   Device Node:              /dev/disk10s2
   Part of Whole:            disk10
   Device / Media Name:      disk image

   Volume Name:              Time Machine Backups
   Escaped with Unicode:     Time%FF%FE%20%00Machine%FF%FE%20%00Backups

   Mounted:                  Yes
   Mount Point:              /Volumes/Time Machine Backups
   Escaped with Unicode:     /Volumes/Time%FF%FE%20%00Machine%FF%FE%20%00Backups

   File System Personality:  Case-sensitive Journaled HFS+
   Type (Bundle):            hfs
   Name (User Visible):      Mac OS Extended (Case-sensitive, Journaled)
   Journal:                  Journal size 40960 KB at offset 0xe46000
   Owners:                   Enabled

   Partition Type:           Apple_HFS
   OS Can Be Installed:      Yes
   Media Type:               Generic
   Protocol:                 Disk Image
   SMART Status:             Not Supported
   Volume UUID:              FDFA163D-107B-3CDE-B077-99E71EE9BA49

   Total Size:               490.3 GB (490320846848 Bytes) (exactly 957657904 512-Byte-Blocks)
   Volume Free Space:        106.0 MB (106049536 Bytes) (exactly 207128 512-Byte-Blocks)
   Device Block Size:        512 Bytes

   Read-Only Media:          No
   Read-Only Volume:         No
   Ejectable:                Yes

   Whole:                    No
   Internal:                 No

macbookpro08-centrim:blocky-OS gjp22$


That type of edge case may be difficult to reproduce. Normal use of Time Machine in Mountain Lion, with ZEVO defaults, is unlikely to cause a problem.
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: ilovezfs and 1 guest

cron