I manage a few Linux servers, and in a few of them, if I want to perform backups, I can leverage filesystem snapshots. I.e. I can create a snapshot and then clone it to a second machine, thus ensuring all data is safe.
On macOS, direct snapshot cloning is not possible. However, according to guides I've seen online, it should be possible to:
- Create a snapshot of the root folder /
- Mount that snapshot as read-only
- Copy the files from the mount point, for example, using rsync
This is just like Carbon Copy Cloner and Active Backup for Business (from Synology), which both take a snapshot first and then copy the contents from it during the backup.
As far as I understand, it should be as simple as:
$ tmutil localsnapshot /
$ tmutil listlocalsnapshots / # Ex: latest snapshot = com.apple.TimeMachine.2024-06-12-114527.local
$ mount_apfs -s com.apple.TimeMachine.2024-06-12-114527.local / /private/tmp/rsync-apfs # folder /private/tmp/rsync-apfs created by me
$ # ...access /private/tmp/rsync-apfs and copy contents using rsync
Unfortunately, mount_apfs
gives the following error:
mount_apfs: volume could not be mounted: Resource busy
I also saw here a variation of these commands where "/" is substituted with "/System/Volumes/Data", in which case the error I get is:
mount_apfs: volume could not be mounted: Operation not permitted
Running with sudo
produces the same results. What is the issue here? Searching on google for these two errors did not produce any solutions.
Edit: In case it is relevant, I'm on macOS Ventura 13.6.4