On macOS in past years I have been able to use dd to copy an entire hard drive to another hard drive of the same size. When I did this, everything was copied: the partition map, the volumes, everything. The copied-to drive was an exact copy of the original in all details.
Yesterday I tried the same thing in macOS Big Sur. The drive I copied from is encrypted and contains only one volume, which contains Time Machine backups.
Disk Utility says this about the drive I copied from:
- Drive model: “Seagate Desktop Media”
- Drive subtitle: “USB External Physical Disk – GUID Partition Map”
- Drive size: 8 TB
- Volume: “mybackup”, formatted as “CoreStorage Logical Volume” Disk Utility lets me decrypt-then-mount the “mybackup” volume.
The shell command I used to do the copy:
time caffeinate sudo gdd if=/dev/rdisk2 of=/dev/rdisk3 bs=1024M status=progress conv=noerror,sync
That ran for 28 hours. I assume that if there were errors, gdd
would have said something. It did not.
Result: Disk Utility says this about the drive I copied to:
- Drive model: “Seagate Backup+ Hub BK Media”
- Drive subtitle: “USB External Physical Disk – GUID Partition Map”
- Drive size: 8 TB
- (no volumes)
Why no volume? Is there some metadata that needs to be copied but isn’t accessible in the raw disk contents?
There is no other disk that could have been /dev/rdisk3
and the copy did not go to a plain file.
UPDATE
Later, after reinstalling the OS on an erased disk, I tried to mount the copy again, and it worked.
dd
a disk that's using Core Storage created under macOS as it's now currently implemented with APFS when thedd
is done on a Mac. I was just getting ready to test doing thedd
on the drive created under macOS from Linux to see if the results are any different. I won't know until tomorrow.asr
if I had to attempt this or maybe carbon copy cloner or super duper so I could open a ticket with the developers. Usingdd
of some flavor will certainly teach us all some things. +1hdiutil imageinfo Encrypted.dmg
I get the expected output as well as in Linux I can mount it and it shows the same layout as the physical disk. Since the image will not mount in macOS I'm not going to waste time wiping the drive and creating an APFS Apple_CoreStorage Encrypted drive. Sorry.