command line – How can I mount a TimeMachine Backup snapshot within the Terminal through mount_apfs?

[ad_1]

Half 1 – the position of /Volumes/.timemachine

There’s a false impression about what’s in /Volumes/.timemachine/<GUID>/. It comprises mount factors which can or could not have mounted TM snapshots. A few of these mount factors relate to TM snapshots which nonetheless exists, however most check with snapshots which have been thinned and so not exist.

If I select a mount level for a snapshot which not exists then, such as you, I get nothing:

ls -l /Volumes/.timemachine/84A3891E-14F5-4FEE-A1A0-F3F501863D11/2024-04-12-015857.backup
complete 0

However I can use Finder to see which snapshots nonetheless exist in my TM backup. Select one among them and ls provides:

ls -l /Volumes/.timemachine/84A3891E-14F5-4FEE-A1A0-F3F501863D11/2024-04-11-124649.backup
complete 64
drwxr-xr-x@ 5 root  wheel    160 11 Apr 12:44 2024-04-11-124649.backup
-rw-r--r--@ 1 root  wheel  32077 11 Apr 11:46 backup_manifest.plist

(I’ve intentionally used ls -l and never ls -1 as you probably did)

Go one degree deeper to see the - Information folder:

ls -l /Volumes/.timemachine/84A3891E-14F5-4FEE-A1A0-F3F501863D11/2024-04-11-124649.backup/2024-04-11-124649.backup
complete 0
drwxrwxr-x@ 22 root  admin  704 11 Apr 12:46 BethSSD - Information

I’m considerably stunned that macOS doesn’t take away the mount factors referring to thinned (not present) snapshots.

Half 2 – mounting TM snapshots utilizing mount_apfs

In my instance beneath, my TM quantity known as TM-Duff.

First listing the snapshots TM snapshots with:

diskutil apfs listSnapshots /Volumes/TM-Duff

This lists all of the snapshots. Right here is only one of them:

+-- C67959A1-ACAD-47D9-9FAB-17A9B4988BD8
|   Identify:        com.apple.TimeMachine.2024-03-31-192542.backup
|   XID:         2229
|   Purgeable:   Sure

Now it may be mounted utilizing:

mount_apfs -o ro -s com.apple.TimeMachine.2024-03-31-192542.backup /Volumes/TM-Duff ~/Temp/mp

the place ~/Temp/mp is an empty listing to make use of as a mount level. See man mount_apfs for a reasonably poor description of the command.

Now use ls -l ~/Temp/mp to see the content material of the backup. Just a few folders down the tree:

ls -l ~/Temp/mp/2024-03-31-192542.backup/Information
complete 3840
drwxrwxr-x@ 171 root  admin  5472 23 Mar 20:18 Functions
-rw-r--r--@   1 root  wheel     0 24 Mar 20:11 Icon?
drwxr-xr-x@  67 root  wheel  2144  9 Mar 20:12 Library
drwxr-xr-x@   3 root  wheel    96  7 Nov 14:48 MobileSoftwareUpdate
drwxr-xr-x@   3 root  wheel    96 29 Feb 15:05 System
drwxr-xr-x@   6 root  admin   192  9 Mar 20:12 Customers
drwxr-xr-x@   2 root  wheel    64 24 Mar 20:04 Volumes
drwxrwxr-t@   2 root  admin    64 11 Jul  2023 cores
drwxr-xr-x@   2 root  wheel    64 11 Jul  2023 mnt
drwxr-xr-x@   3 root  wheel    96 12 Nov 15:26 decide
drwxr-xr-x@   6 root  wheel   192  9 Mar 20:12 personal
drwxr-xr-x@   2 root  wheel    64 11 Jul  2023 sw
drwxr-xr-x@   5 root  wheel   160 29 Feb 15:05 usr

(simply the identical as Finder reveals.)

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *