When migrating to a new Mac or configuring a fleet of identical lab computers, manually reinstalling the operating system and copying files over a network is incredibly inefficient. While graphical utilities like Disk Utility offer cloning features, the most powerful and reliable tool for creating an exact, bit-for-bit duplicate of a hard drive is built directly into the macOS Terminal. The asr (Apple Software Restore) command performs block-level cloning, meaning it copies the physical data structure of the disk perfectly, resulting in significantly faster transfer speeds than standard file copying.
Why Use Block-Level Cloning?
Standard file transfer protocols read a file, create a new file on the destination drive, and write the data into it. This introduces massive overhead, especially when copying millions of tiny system files. The asr command bypasses the file system entirely during a block copy. It reads the raw magnetic blocks of the source drive and pastes them exactly onto the target drive. This ensures that boot partitions, hidden recovery volumes, and APFS container structures are replicated flawlessly.
What You Need Before Starting
Because the asr command overwrites the physical structure of a disk, any data currently on the destination drive will be permanently erased. You must correctly identify your source and target drives before running this command, as a simple typo could result in catastrophic data loss. Furthermore, this command must be run with sudo privileges.
Identifying Your Drives
Before initiating the clone, you need to find the device identifiers for your drives.
- Open the Terminal application.
- Type
diskutil listand press Enter. - Examine the output. You are looking for identifiers like
/dev/disk1or/dev/disk2. Note down the exact identifier for your source drive and your target drive.
Executing the Clone Process
Once you are absolutely certain of your device identifiers, you can begin the cloning process. In this example, we will assume your source drive is /dev/disk1 and your empty target drive is /dev/disk2.
To initiate a direct, block-level clone, run the following command:
sudo asr restore --source /dev/disk1 --target /dev/disk2 --erase
The command flags explained:
- –source: The drive you want to copy from.
- –target: The drive you are copying to.
- –erase: This mandatory flag instructs the utility to wipe the target drive completely before writing the new block data.
Press Enter and type your administrator password. The asr utility will begin validating the target, erasing it, and copying the blocks. You will see a percentage progress indicator in the Terminal. Depending on the size and speed of the drives, this process can take anywhere from a few minutes to several hours.
Cloning to a Disk Image File
The asr command is also highly effective for creating golden master images for corporate deployment. Instead of targeting a physical disk, you can clone a physical volume into a compressed .dmg file.
sudo asr restore --source /dev/disk1 --target ~/Desktop/GoldenMaster.dmg --erase
This image file can then be stored on a network server and restored to multiple client machines using the exact same asr command in reverse.