Last active
March 17, 2021 01:13
-
-
Save takaxp/81fe2cb78d029a15dfc4bd22399dea40 to your computer and use it in GitHub Desktop.
Clone APFS bootable volume (from internal SSD to external HDD)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see https://discussions.apple.com/thread/8384650 | |
# disk2: main drive as source (SSD) | |
# disk2s1: Macintosh HD | |
# disk2s2: Preboot for disk2s1 | |
# disk5: external drive as destination (HDD) | |
# disk5s1: Untitled | |
# disk5s2: Preboot for disk5s1 | |
sudo vsdbutil -a /Volumes/Untitled | |
sudo rsync -xrlptgoEvHS --progress --delete / /Volumes/Untitled | |
diskutil list | |
diskutil apfs addVolume disk5 apfs Preboot -role B # as '/Volumes/Preboot' | |
diskutil info disk5s1 | grep "Volume UUID" # will return <UUID of disk5s1> | |
mkdir /Volumes/Preboot/<UUID of disk5s1> | |
diskutil mount disk2s2 # as '/Volumes/Preboot 1' | |
diskutil info disk2s1 | grep "Volume UUID" # will return <UUID of disk2s1> | |
sudo rsync -xrlptgoEvHS --progress --delete '/Volumes/Preboot 1/<UUID of disk2s1>/' '/Volumes/Preboot/<UUID of disk5s1>/' | |
diskutil unmount disk2s2 | |
diskutil unmount disk5s2 | |
sudo bless --folder /Volumes/Untitled/System/Library/CoreServices --bootefi | |
sudo update_dyld_shared_cache -root /Volumes/Untitled -force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following attempts will be failed when cloning APFS volume:
The operation will be finished with an error code like OSStatus error XX:
Then, just manually try the above procedure :)