Suppose I have a full TimeMachine backup of a newly installed and configured Mac OS. No important data yet.
I want to test disaster recovery from the scenario of total physical loss. I don't want to destroy the Mac for real and get a new one, so I need to emulate the situation that the Mac is now the replacement with an empty hard drive.
How to do that?
About 10 years ago I would just do something like:
sudo dd if=/dev/zero of=/dev/disk0 count=128 bs=1M
On modern, cutting-edge Macs, however, I am not even sure if that will work (maybe there are some belts & braces against doing it even for root, or maybe it will not actually wipe the data on the very underlying physical drive, I don't know).
The disks look this:
sudo diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: Apple_APFS_ISC Container disk1 524.3 MB disk0s1
2: Apple_APFS Container disk3 494.4 GB disk0s2
3: Apple_APFS_Recovery Container disk2 5.4 GB disk0s3
/dev/disk3 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +494.4 GB disk3
Physical Store disk0s2
1: APFS Volume Macintosh HD 10.3 GB disk3s1
2: APFS Snapshot com.apple.os.update-... 10.3 GB disk3s1s1
3: APFS Volume Preboot 5.4 GB disk3s2
4: APFS Volume Recovery 939.8 MB disk3s3
5: APFS Volume Data 30.0 GB disk3s5
6: APFS Volume VM 20.5 KB disk3s6
So, how to wipe my Mac to test disaster recovery?
dd
where a simplecat
will do.dd
allows to set the amount of data to be written. How a simplecat
can do it?dd
, which is often-repeated advice for imaging or erasing entire drives where plaincat
would be better. You're right, if you want control over the amount of data written,dd
is appropriate.