Skip to main content
The 2024 Developer Survey results are live! See the results
additional command output
Source Link
    $ diskutil list
/dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *1.0 TB     disk0
       1:                        EFI ���EFI⁩                     209.7 MB   disk0s1
       2:                 Apple_APFS ⁨Container disk1⁩         873.0 GB   disk0s2
       3:       Microsoft Basic Data ⁨BOOTCAMP⁩                127.3 GB   disk0s3
    
    /dev/disk1 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +873.0 GB   disk1
                                     Physical Store disk0s2
       1:                APFS Volume ⁨Macintosh HD - Data⁩     373.6 GB   disk1s1
       2:                APFS Volume ⁨Preboot⁩                 675.8 MB   disk1s2
       3:                APFS Volume ⁨Recovery⁩                2.2 GB     disk1s3
       4:                APFS Volume ⁨VM⁩                      1.1 MB     disk1s4
       5:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk1s5
       6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB    disk1s5s1
    
    /dev/disk2 (external, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *960.2 GB   disk2
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
       2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2
    
    /dev/disk3 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +960.0 GB   disk3
                                     Physical Store disk2s2
       1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
       2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
       3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
       4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4

$ diskutil mount disk1s5
$ diskutil apfs listsnapshots disk1s5
Snapshot for disk1s5 (1 found)
|
+-- 173CBA59-B437-43E0-9904-B28B2F714F0B
    Name:        com.apple.os.update-CB12C14C05552C076D856AD12B102E53CCB8AB4E163547432B0577BE3AE6B5E9
    XID:         21541437 (Will root to (boot from) this snapshot)
    Purgeable:   No


$ time sudo asr restore --no-personalization --erase \
                 --source /dev/disk1s5        \
                 --target /dev/disk2s2        \
                 --toSnapshot 173CBA59-B437-43E0-9904-B28B2F714F0B 


    Validating target...done
    Validating source...done
    Erase contents of /dev/disk3 ()? [ny]: y
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Restored target device is /dev/disk3s2.
Restore completed successfully.

$ diskutil list virtual
/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +873.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume ⁨Macintosh HD - Data⁩     371.0 GB   disk1s1
   2:                APFS Volume ⁨Preboot⁩                 675.8 MB   disk1s2
   3:                APFS Volume ⁨Recovery⁩                2.2 GB     disk1s3
   4:                APFS Volume ⁨VM⁩                      1.1 MB     disk1s4
   5:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk1s5
   6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB    disk1s5s1

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +4.0 TB     disk3
                                 Physical Store disk2s2
   1:                APFS Volume ⁨Macintosh HD - Data⁩     367.5 GB   disk3s1
   2:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk3s2
   3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
   4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4
$ diskutil mount disk3s1
$ diskutil renameVolume disk3s1 "Clone MacOS - Data"
$ diskutil mount disk3s2
$ diskutil renameVolume disk3s2 "Clone MacOS"
$ sudo bless -mount "/Volumes/Clone MacOS" -setBoot
$ diskutil eject /dev/disk3
$ diskutil list external
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *960.2 GB   disk2
   1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
   2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +960.0 GB   disk3
                                 Physical Store disk2s2
   1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
   2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
   3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
   4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4
    $ diskutil list
/dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *1.0 TB     disk0
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk0s1
       2:                 Apple_APFS ⁨Container disk1⁩         873.0 GB   disk0s2
       3:       Microsoft Basic Data ⁨BOOTCAMP⁩                127.3 GB   disk0s3
    
    /dev/disk1 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +873.0 GB   disk1
                                     Physical Store disk0s2
       1:                APFS Volume ⁨Macintosh HD - Data⁩     373.6 GB   disk1s1
       2:                APFS Volume ⁨Preboot⁩                 675.8 MB   disk1s2
       3:                APFS Volume ⁨Recovery⁩                2.2 GB     disk1s3
       4:                APFS Volume ⁨VM⁩                      1.1 MB     disk1s4
       5:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk1s5
       6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB    disk1s5s1
    
    /dev/disk2 (external, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *960.2 GB   disk2
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
       2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2
    
    /dev/disk3 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +960.0 GB   disk3
                                     Physical Store disk2s2
       1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
       2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
       3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
       4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4

$ diskutil mount disk1s5
$ diskutil apfs listsnapshots disk1s5
Snapshot for disk1s5 (1 found)
|
+-- 173CBA59-B437-43E0-9904-B28B2F714F0B
    Name:        com.apple.os.update-CB12C14C05552C076D856AD12B102E53CCB8AB4E163547432B0577BE3AE6B5E9
    XID:         21541437 (Will root to (boot from) this snapshot)
    Purgeable:   No


$ time sudo asr restore --no-personalization --erase \
                 --source /dev/disk1s5        \
                 --target /dev/disk2s2        \
                 --toSnapshot 173CBA59-B437-43E0-9904-B28B2F714F0B 


    Validating target...done
    Validating source...done
    Erase contents of /dev/disk3 ()? [ny]: y
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Restored target device is /dev/disk3s2.
Restore completed successfully.

$ diskutil list virtual
$ diskutil mount disk3s1
$ diskutil renameVolume disk3s1 "Clone MacOS - Data"
$ diskutil mount disk3s2
$ diskutil renameVolume disk3s2 "Clone MacOS"
$ sudo bless -mount "/Volumes/Clone MacOS" -setBoot
$ diskutil eject /dev/disk3
$ diskutil list external
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *960.2 GB   disk2
   1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
   2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +960.0 GB   disk3
                                 Physical Store disk2s2
   1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
   2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
   3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
   4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4
    $ diskutil list
/dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *1.0 TB     disk0
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk0s1
       2:                 Apple_APFS ⁨Container disk1⁩         873.0 GB   disk0s2
       3:       Microsoft Basic Data ⁨BOOTCAMP⁩                127.3 GB   disk0s3
    
    /dev/disk1 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +873.0 GB   disk1
                                     Physical Store disk0s2
       1:                APFS Volume ⁨Macintosh HD - Data⁩     373.6 GB   disk1s1
       2:                APFS Volume ⁨Preboot⁩                 675.8 MB   disk1s2
       3:                APFS Volume ⁨Recovery⁩                2.2 GB     disk1s3
       4:                APFS Volume ⁨VM⁩                      1.1 MB     disk1s4
       5:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk1s5
       6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB    disk1s5s1
    
    /dev/disk2 (external, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *960.2 GB   disk2
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
       2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2
    
    /dev/disk3 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +960.0 GB   disk3
                                     Physical Store disk2s2
       1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
       2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
       3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
       4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4

$ diskutil mount disk1s5
$ diskutil apfs listsnapshots disk1s5
Snapshot for disk1s5 (1 found)
|
+-- 173CBA59-B437-43E0-9904-B28B2F714F0B
    Name:        com.apple.os.update-CB12C14C05552C076D856AD12B102E53CCB8AB4E163547432B0577BE3AE6B5E9
    XID:         21541437 (Will root to (boot from) this snapshot)
    Purgeable:   No


$ time sudo asr restore --no-personalization --erase \
                 --source /dev/disk1s5        \
                 --target /dev/disk2s2        \
                 --toSnapshot 173CBA59-B437-43E0-9904-B28B2F714F0B 


    Validating target...done
    Validating source...done
    Erase contents of /dev/disk3 ()? [ny]: y
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Restored target device is /dev/disk3s2.
Restore completed successfully.

$ diskutil list virtual
/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +873.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume ⁨Macintosh HD - Data⁩     371.0 GB   disk1s1
   2:                APFS Volume ⁨Preboot⁩                 675.8 MB   disk1s2
   3:                APFS Volume ⁨Recovery⁩                2.2 GB     disk1s3
   4:                APFS Volume ⁨VM⁩                      1.1 MB     disk1s4
   5:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk1s5
   6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB    disk1s5s1

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +4.0 TB     disk3
                                 Physical Store disk2s2
   1:                APFS Volume ⁨Macintosh HD - Data⁩     367.5 GB   disk3s1
   2:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk3s2
   3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
   4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4
$ diskutil mount disk3s1
$ diskutil renameVolume disk3s1 "Clone MacOS - Data"
$ diskutil mount disk3s2
$ diskutil renameVolume disk3s2 "Clone MacOS"
$ sudo bless -mount "/Volumes/Clone MacOS" -setBoot
$ diskutil eject /dev/disk3
$ diskutil list external
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *960.2 GB   disk2
   1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
   2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +960.0 GB   disk3
                                 Physical Store disk2s2
   1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
   2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
   3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
   4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4
moved all the code example out of the instruction list, wasn't formatting correctly in combination with the numbered list.
Source Link
  1. Identify and mount your internal "Macintosh HD" APFS volume on the virtual disk within your APFS container scheme synthesized from your internal physical disk. Sometimes it helps to list your disks filtered separately by physical or virtual with the commands: diskutil list physical && diskutil list virtual

    $ diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *1.0 TB disk0 1: EFI ⁨EFI⁩ 209.7 MB disk0s1 2: Apple_APFS ⁨Container disk1⁩ 873.0 GB disk0s2 3: Microsoft Basic Data ⁨BOOTCAMP⁩ 127.3 GB disk0s3

    /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +873.0 GB disk1 Physical Store disk0s2 1: APFS Volume ⁨Macintosh HD - Data⁩ 370.7 GB disk1s1 2: APFS Volume ⁨Preboot⁩ 675.8 MB disk1s2 3: APFS Volume ⁨Recovery⁩ 2.2 GB disk1s3 4: APFS Volume ⁨VM⁩ 1.1 MB disk1s4 5: APFS Volume ⁨Macintosh HD⁩ 15.4 GB disk1s5 6: APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB disk1s5s1

    /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *4.0 TB disk2 1: EFI ⁨EFI⁩ 209.7 MB disk2s1 2: Apple_APFS ⁨Container disk3⁩ 4.0 TB disk2s2

    /dev/disk3 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +4.0 TB disk3 Physical Store disk2s2 1: APFS Volume ⁨Untitled⁩ 811.0 KB disk3s1

  2. Mount the "Macintosh HD" volume from the internal virtual disk using it's disk identifier (e.g. disk1s5) with the command: diskutil mount disk1s5

  3. find the GUID of the system disk snapshot using the disk identifier you just mounted with the command: diskutil apfs listsnapshots disk1s5; The GUID you want is the one on the line that starts with +--

    $ diskutil apfs listsnapshots disk1s5 Snapshot for disk1s5 (1 found) | +-- 173CBA59-B437-43E0-9904-B28B2F714F0B Name: com.apple.os.update-CB12C14C05552C076D856AD12B102E53CCB8AB4E163547432B0577BE3AE6B5E9 XID: 21541437 (Will root to (boot from) this snapshot) Purgeable: No

  4. Find the disk identifier (e.g. disk2s2) for the APFS Container disk on your external physical drive volume with the command: diskutil list external physical | grep Container;

  5. Execute the ASR command with appropriate restore parameters, including the source and target volumes, and the snapshot GUID. This will restore your system onto the external drive APFS container. The command is long, so I've separated it onto multiple lines with the backslash character to make it work as a single command when pasted:

    time sudo asr restore --no-personalization --erase
    --source /dev/disk1s5
    --target /dev/disk2s2
    --toSnapshot 173CBA59-B437-43E0-9904-B28B2F714F0B

    $ diskutil list
/dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *1.0 TB     disk0
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk0s1
       2:                 Apple_APFS ⁨Container disk1⁩         873.0 GB   disk0s2
       3:       Microsoft Basic Data ⁨BOOTCAMP⁩                127.3 GB   disk0s3
    
    /dev/disk1 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +873.0 GB   disk1
                                     Physical Store disk0s2
       1:                APFS Volume ⁨Macintosh HD - Data⁩     373.6 GB   disk1s1
       2:                APFS Volume ⁨Preboot⁩                 675.8 MB   disk1s2
       3:                APFS Volume ⁨Recovery⁩                2.2 GB     disk1s3
       4:                APFS Volume ⁨VM⁩                      1.1 MB     disk1s4
       5:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk1s5
       6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB    disk1s5s1
    
    /dev/disk2 (external, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *960.2 GB   disk2
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
       2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2
    
    /dev/disk3 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +960.0 GB   disk3
                                     Physical Store disk2s2
       1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
       2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
       3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
       4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4

$ diskutil mount disk1s5
$ diskutil apfs listsnapshots disk1s5
Snapshot for disk1s5 (1 found)
|
+-- 173CBA59-B437-43E0-9904-B28B2F714F0B
    Name:        com.apple.os.update-CB12C14C05552C076D856AD12B102E53CCB8AB4E163547432B0577BE3AE6B5E9
    XID:         21541437 (Will root to (boot from) this snapshot)
    Purgeable:   No


$ time sudo asr restore --no-personalization --erase \
                 --source /dev/disk1s5        \
                 --target /dev/disk2s2        \
                 --toSnapshot 173CBA59-B437-43E0-9904-B28B2F714F0B 


    Validating target...done
    Validating source...done
    Erase contents of /dev/disk3 ()? [ny]: y
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Restored target device is /dev/disk3s2.
Restore completed successfully.

$ diskutil list virtual
$ diskutil mount disk3s1
$ diskutil renameVolume disk3s1 "Clone MacOS - Data"
$ diskutil mount disk3s2
$ diskutil renameVolume disk3s2 "Clone MacOS"
$ sudo bless -mount "/Volumes/Clone MacOS" -setBoot
$ diskutil eject /dev/disk3
$ diskutil list external
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *960.2 GB   disk2
   1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
   2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +960.0 GB   disk3
                                 Physical Store disk2s2
   1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
   2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
   3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
   4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4
  1. Identify and mount your internal "Macintosh HD" APFS volume on the virtual disk within your APFS container scheme synthesized from your internal physical disk. Sometimes it helps to list your disks filtered separately by physical or virtual with the commands: diskutil list physical && diskutil list virtual

    $ diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *1.0 TB disk0 1: EFI ⁨EFI⁩ 209.7 MB disk0s1 2: Apple_APFS ⁨Container disk1⁩ 873.0 GB disk0s2 3: Microsoft Basic Data ⁨BOOTCAMP⁩ 127.3 GB disk0s3

    /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +873.0 GB disk1 Physical Store disk0s2 1: APFS Volume ⁨Macintosh HD - Data⁩ 370.7 GB disk1s1 2: APFS Volume ⁨Preboot⁩ 675.8 MB disk1s2 3: APFS Volume ⁨Recovery⁩ 2.2 GB disk1s3 4: APFS Volume ⁨VM⁩ 1.1 MB disk1s4 5: APFS Volume ⁨Macintosh HD⁩ 15.4 GB disk1s5 6: APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB disk1s5s1

    /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *4.0 TB disk2 1: EFI ⁨EFI⁩ 209.7 MB disk2s1 2: Apple_APFS ⁨Container disk3⁩ 4.0 TB disk2s2

    /dev/disk3 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +4.0 TB disk3 Physical Store disk2s2 1: APFS Volume ⁨Untitled⁩ 811.0 KB disk3s1

  2. Mount the "Macintosh HD" volume from the internal virtual disk using it's disk identifier (e.g. disk1s5) with the command: diskutil mount disk1s5

  3. find the GUID of the system disk snapshot using the disk identifier you just mounted with the command: diskutil apfs listsnapshots disk1s5; The GUID you want is the one on the line that starts with +--

    $ diskutil apfs listsnapshots disk1s5 Snapshot for disk1s5 (1 found) | +-- 173CBA59-B437-43E0-9904-B28B2F714F0B Name: com.apple.os.update-CB12C14C05552C076D856AD12B102E53CCB8AB4E163547432B0577BE3AE6B5E9 XID: 21541437 (Will root to (boot from) this snapshot) Purgeable: No

  4. Find the disk identifier (e.g. disk2s2) for the APFS Container disk on your external physical drive volume with the command: diskutil list external physical | grep Container;

  5. Execute the ASR command with appropriate restore parameters, including the source and target volumes, and the snapshot GUID. This will restore your system onto the external drive APFS container. The command is long, so I've separated it onto multiple lines with the backslash character to make it work as a single command when pasted:

    time sudo asr restore --no-personalization --erase
    --source /dev/disk1s5
    --target /dev/disk2s2
    --toSnapshot 173CBA59-B437-43E0-9904-B28B2F714F0B

diskutil list virtual
diskutil mount disk3s1
diskutil renameVolume disk3s1 "Clone MacOS - Data"
diskutil mount disk3s2
diskutil renameVolume disk3s2 "Clone MacOS"
sudo bless -mount "/Volumes/Clone MacOS" -setBoot
diskutil eject /dev/disk3
diskutil list external
  1. Identify and mount your internal "Macintosh HD" APFS volume on the virtual disk within your APFS container scheme synthesized from your internal physical disk. Sometimes it helps to list your disks filtered separately by physical or virtual with the commands: diskutil list physical && diskutil list virtual

  2. Mount the "Macintosh HD" volume from the internal virtual disk using it's disk identifier (e.g. disk1s5) with the command: diskutil mount disk1s5

  3. find the GUID of the system disk snapshot using the disk identifier you just mounted with the command: diskutil apfs listsnapshots disk1s5; The GUID you want is the one on the line that starts with +--

  4. Find the disk identifier (e.g. disk2s2) for the APFS Container disk on your external physical drive volume with the command: diskutil list external physical | grep Container;

  5. Execute the ASR command with appropriate restore parameters, including the source and target volumes, and the snapshot GUID. This will restore your system onto the external drive APFS container.

    $ diskutil list
/dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *1.0 TB     disk0
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk0s1
       2:                 Apple_APFS ⁨Container disk1⁩         873.0 GB   disk0s2
       3:       Microsoft Basic Data ⁨BOOTCAMP⁩                127.3 GB   disk0s3
    
    /dev/disk1 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +873.0 GB   disk1
                                     Physical Store disk0s2
       1:                APFS Volume ⁨Macintosh HD - Data⁩     373.6 GB   disk1s1
       2:                APFS Volume ⁨Preboot⁩                 675.8 MB   disk1s2
       3:                APFS Volume ⁨Recovery⁩                2.2 GB     disk1s3
       4:                APFS Volume ⁨VM⁩                      1.1 MB     disk1s4
       5:                APFS Volume ⁨Macintosh HD⁩            15.4 GB    disk1s5
       6:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB    disk1s5s1
    
    /dev/disk2 (external, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *960.2 GB   disk2
       1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
       2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2
    
    /dev/disk3 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +960.0 GB   disk3
                                     Physical Store disk2s2
       1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
       2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
       3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
       4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4

$ diskutil mount disk1s5
$ diskutil apfs listsnapshots disk1s5
Snapshot for disk1s5 (1 found)
|
+-- 173CBA59-B437-43E0-9904-B28B2F714F0B
    Name:        com.apple.os.update-CB12C14C05552C076D856AD12B102E53CCB8AB4E163547432B0577BE3AE6B5E9
    XID:         21541437 (Will root to (boot from) this snapshot)
    Purgeable:   No


$ time sudo asr restore --no-personalization --erase \
                 --source /dev/disk1s5        \
                 --target /dev/disk2s2        \
                 --toSnapshot 173CBA59-B437-43E0-9904-B28B2F714F0B 


    Validating target...done
    Validating source...done
    Erase contents of /dev/disk3 ()? [ny]: y
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Replicating ....10....20....30....40....50....60....70....80....90....100
    Restored target device is /dev/disk3s2.
Restore completed successfully.

$ diskutil list virtual
$ diskutil mount disk3s1
$ diskutil renameVolume disk3s1 "Clone MacOS - Data"
$ diskutil mount disk3s2
$ diskutil renameVolume disk3s2 "Clone MacOS"
$ sudo bless -mount "/Volumes/Clone MacOS" -setBoot
$ diskutil eject /dev/disk3
$ diskutil list external
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *960.2 GB   disk2
   1:                        EFI ⁨EFI⁩                     209.7 MB   disk2s1
   2:                 Apple_APFS ⁨Container disk3⁩         960.0 GB   disk2s2

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +960.0 GB   disk3
                                 Physical Store disk2s2
   1:                APFS Volume ⁨Clone MacOS - Data⁩      367.6 GB   disk3s1
   2:                APFS Volume ⁨Clone MacOS⁩             15.4 GB    disk3s2
   3:                APFS Volume ⁨Preboot⁩                 629.0 MB   disk3s3
   4:                APFS Volume ⁨Recovery⁩                1.1 GB     disk3s4
Source Link

resurrecting this to provide the current solution.

Modern MacOS on both Intel and Silicon can use the Apple "ASR" utility to clone their drive completely. See: https://discussions.apple.com/docs/DOC-250005828

The trick to it is making sure you properly select the correct APFS volumes for the command depending on what you want to do.

To fully clone your boot drive over to a freshly formatted APFS external drive:

  1. Identify and mount your internal "Macintosh HD" APFS volume on the virtual disk within your APFS container scheme synthesized from your internal physical disk. Sometimes it helps to list your disks filtered separately by physical or virtual with the commands: diskutil list physical && diskutil list virtual

    $ diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *1.0 TB disk0 1: EFI ⁨EFI⁩ 209.7 MB disk0s1 2: Apple_APFS ⁨Container disk1⁩ 873.0 GB disk0s2 3: Microsoft Basic Data ⁨BOOTCAMP⁩ 127.3 GB disk0s3

    /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +873.0 GB disk1 Physical Store disk0s2 1: APFS Volume ⁨Macintosh HD - Data⁩ 370.7 GB disk1s1 2: APFS Volume ⁨Preboot⁩ 675.8 MB disk1s2 3: APFS Volume ⁨Recovery⁩ 2.2 GB disk1s3 4: APFS Volume ⁨VM⁩ 1.1 MB disk1s4 5: APFS Volume ⁨Macintosh HD⁩ 15.4 GB disk1s5 6: APFS Snapshot ⁨com.apple.os.update-...⁩ 15.4 GB disk1s5s1

    /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *4.0 TB disk2 1: EFI ⁨EFI⁩ 209.7 MB disk2s1 2: Apple_APFS ⁨Container disk3⁩ 4.0 TB disk2s2

    /dev/disk3 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +4.0 TB disk3 Physical Store disk2s2 1: APFS Volume ⁨Untitled⁩ 811.0 KB disk3s1

  2. Mount the "Macintosh HD" volume from the internal virtual disk using it's disk identifier (e.g. disk1s5) with the command: diskutil mount disk1s5

  3. find the GUID of the system disk snapshot using the disk identifier you just mounted with the command: diskutil apfs listsnapshots disk1s5; The GUID you want is the one on the line that starts with +--

    $ diskutil apfs listsnapshots disk1s5 Snapshot for disk1s5 (1 found) | +-- 173CBA59-B437-43E0-9904-B28B2F714F0B Name: com.apple.os.update-CB12C14C05552C076D856AD12B102E53CCB8AB4E163547432B0577BE3AE6B5E9 XID: 21541437 (Will root to (boot from) this snapshot) Purgeable: No

  4. Find the disk identifier (e.g. disk2s2) for the APFS Container disk on your external physical drive volume with the command: diskutil list external physical | grep Container;

  5. Execute the ASR command with appropriate restore parameters, including the source and target volumes, and the snapshot GUID. This will restore your system onto the external drive APFS container. The command is long, so I've separated it onto multiple lines with the backslash character to make it work as a single command when pasted:

    time sudo asr restore --no-personalization --erase
    --source /dev/disk1s5
    --target /dev/disk2s2
    --toSnapshot 173CBA59-B437-43E0-9904-B28B2F714F0B

Once this is completed, it is best to rename your cloned volumes so they can be easily distinguished from your internal drive's volume names. The new system volume must also be "blessed" in order for it to be bootable. We can do both of these things together.

If on Apple Silicon, there may be other steps required. Consult the article linked above.

diskutil list virtual
diskutil mount disk3s1
diskutil renameVolume disk3s1 "Clone MacOS - Data"
diskutil mount disk3s2
diskutil renameVolume disk3s2 "Clone MacOS"
sudo bless -mount "/Volumes/Clone MacOS" -setBoot
diskutil eject /dev/disk3
diskutil list external

Once this is done, reboot with the correct key combination (usually OPTION) to select a boot drive, and choose the clone.

Once booted, log-in and wait for the system to fully start all of your desktop services, etc... Some control panel preferences may not work yet.

Once you're fully logged in and everything is started, reboot again. After that, everything should be working. Test your clone well before archiving it. This also works great for replacing your internal drive on older macs that allow such nonsense. :-)

If you want to refresh your clone without fully overwriting it each time, the ASR command target needs to change a bit. Instead of choosing the target to be the APFS container partition on the physical external disk volume, choose the disk identifier for the "Clone MacOS" partition on the synthesized virtual external disk. e.g. disk3s2 in my example.

The one thing I haven't figured out yet is how to also clone an existing BootCamp partition to the clone'd external drive's physical disk.

This might require booting the clone and repeating the bootcamp setup with precisely the same size disk volume settings, and THEN using dd to overwrite the new partition - or restoring a Windows backup... not sure and haven't found a good reference for this yet.