Problem
APFS is amazing... and infuriating with its lack of tools available.
What I'm trying to do is simply an equivalent of btrfs send --no-data -p /snapshots/parent /snapshots/child
My investigation
- Most of the google-fu returns usages of
tmutil
tmutil
is able tolistlocalsnapshots
/deletelocalsnapshots
/localsnapshot
(create)tmutil compare <snapshot_path>
doesn't accept 2 snapshotstmutil compare EXISTING_SNAPSHOT
returns cryptic & undocumentedMust specify a snapshot root when performing a machine comparison.
tmutil calculatedrift <machine_directory>
doesn't seem to be related to APFS snapshotstmutil
contains some undocumented options, but nothing related to snapshots- Snapshot created by
tmutil
have hardcodedcom.apple.TimeMachine.YYYY-MM-DD-HHMMSS.local
naming format
diskutil
contains limited snapshots supportdiskutil deleteSnapshot
works as intendeddiskutil listSnapshots
list snapshots with sizes and some metadata (unliketmutil
)- No facility for creating snapshots
Kernel contains
fs_snapshot_*
syscalls- The documentation is almost non-existent, but a single
man
page is available - All usual operations (
fs_snapshot_delete
/fs_snapshot_list
/fs_snapshot_create
/fs_snapshot_mount
) are supported - GitHub
ahl/apfs
hosts a small utility which demonstrates the syscalls usage fs_snapshot_list
list onlycom.apple.TimeMachine.*
snapshots- Any write operations (e.g.
fs_snapshot_create
) end up with application being killed withfs_snapshot_create: Operation not permitted
(probably due to documented in the man reason: "require an additional entitlement")
- The documentation is almost non-existent, but a single
Commercial app, Carbon Copy Cloner, is able to manipulate snapshots
- For obvious reasons they don't disclose how they do that ;)
Help? ;)
Is there any method of getting a diff between two snapshots? Any documentation how they can be managed?
The only naïve approach which because of speed is not feasible is running rsync
between r/o mounted snapshots... but this is just stupid.