apfs snapshot | cloning

Accidentally added a point to the exceptions of the time machine that is needed.

Hope that the snapshots of the apfs have everything, no exceptions.


I'd found only a hint, how to mount a such one:

mount_apfs -s com.apple.TimeMachine.2021-11-24-124130 / ~/Desktop/111

But this is not the moment that is needed. The snapshot may be busy at all.


And how to make a clone of a snap?

Example on my bsd one:

zfs clone estaf/ww/date@yesterday estaf/home/tmp/point

Posted on Nov 24, 2021 3:00 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 24, 2021 5:51 PM

Hi EsTaF,


Unfortunately APFS doesn't have the ability to create ZFS-style clones of snapshots. You can, however, copy data from a mounted snapshot, or use asr to copy the complete contents and metadata of a snapshot to another APFS volume. Both operations are "copy" operations - they will require more free space than the size of the snapshot contents in order to complete.

Similar questions

6 replies
Question marked as Top-ranking reply

Nov 24, 2021 5:51 PM in response to EsTaF

Hi EsTaF,


Unfortunately APFS doesn't have the ability to create ZFS-style clones of snapshots. You can, however, copy data from a mounted snapshot, or use asr to copy the complete contents and metadata of a snapshot to another APFS volume. Both operations are "copy" operations - they will require more free space than the size of the snapshot contents in order to complete.

Nov 24, 2021 10:11 PM in response to EsTaF

Hi EsTaF,


I took a look at the mount_apfs command and figured out the correct syntax to mount the APFS snapshots!


Let's assume that I have a Time Machine backup store on an APFS volume named "Strawberry", and the volume is mounted at /Volumes/Strawberry. To mount a snapshot named com.apple.TimeMachine.2021-11-23-120928.backup (which resides on Strawberry) at the (pre-existing) directory /tmp/mySnap, use this command:


mount_apfs -s com.apple.TimeMachine.2021-11-23-120928.backup /Volumes/Strawberry /tmp/mySnap


In short (after -s):


  • First: Name of the snapshot you want to mount
  • Second: Mountpoint of the (already mounted) Time Machine backup volume (the live APFS volume that contains the desired snapshot)
  • Third: Directory on which the snapshot should be mounted to


Also, for APFS Time Machine backup drives, there is an easier way to browse snapshots: Simply navigate to the live backup volume in Finder. You'll notice that a lot of disk icons appear inside. Opening any of those will mount the corresponding snapshot and let you view its contents.


If you want to mount a local snapshot (a temporary APFS snapshot of your internal Data volume), try the below instead. This example assumes that the local snapshot is named com.apple.TimeMachine.2021-11-20-115813.local, and I'm trying to mount it at the (pre-existing) directory at /tmp/mySnap:


mount_apfs -s com.apple.TimeMachine.2021-11-20-115813.local /System/Volumes/Data /tmp/mySnap


Hope this helps!


EDIT: Fixed a few things.

Nov 24, 2021 8:56 AM in response to EsTaF

EsTaF wrote:

Accidentally added a point to the exceptions of the time machine that is needed.
Hope that the snapshots of the apfs have everything, no exceptions.

I'd found only a hint, how to mount a such one:
mount_apfs -s com.apple.TimeMachine.2021-11-24-124130 / ~/Desktop/111
But this is not the moment that is needed. The snapshot may be busy at all.

And how to make a clone of a snap?
Example on my bsd one:
zfs clone estaf/ww/date@yesterday estaf/home/tmp/point



"BSD one" ?


This seems a good question for your third party app Developer...?



If in doubt refer to the developers website; Support/Help/FAQ/known issues/compatibility:

https://docs.oracle.com/en/


https://docs.oracle.com/cd/E19253-01/819-5461/gbcxz/index.html



Contact a third party vendor

https://support.apple.com/en-us/HT201777


Other third party options: Carbon Copy Cloner


Leveraging Snapshots on APFS Volumes | Carbon Copy Cloner



What is the bigger picture— independent of your approach above, what is it you are trying to accomplish...?





Nov 24, 2021 9:05 AM in response to leroydouglas

>This seems a good question for your third party app Developer...?


Why... ? This is the same question about the apfs file system.

What is there an Oracle company and third parties have to do with it?


I just to show zfs' example and want to ask, how to realise a snapshot cloning on apfs. The cloning on the fly as on zfs. Not copying with cloning strategy, as in hfs, ntfs etc.

apfs, zfs - It's similar to each other, or am I wrong?

Nov 24, 2021 10:37 PM in response to Encryptor5000

tmutil listlocalsnapshots /System/Volumes/Data                         

Snapshots for disk /System/Volumes/Data:

com.apple.TimeMachine.2021-11-24-094110.local

com.apple.TimeMachine.2021-11-24-104120.local

com.apple.TimeMachine.2021-11-24-114125.local

com.apple.TimeMachine.2021-11-24-124130.local

com.apple.TimeMachine.2021-11-24-131002.local

iron@estaf ~ % mount_apfs -s com.apple.TimeMachine.2021-11-24-124130.local /System/Volumes/Data ~/Desktop/111

mount_apfs: volume could not be mounted: Resource busy


But I hear you.

Yeah, that’s an interesting thing. apfs :)


All important ones I keep on FreeBSD/zfs anyway + a copy on external disk,. Apple’s still a desktop.


Thank you.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

apfs snapshot | cloning

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.