To clone one drive to another you have to prepare the source and the target drive.
- Mark the source drive with a red sticker, if the source and target drive have identical cases!
- Attach both drive but don't mount the encrypted FileVault volume. If it is already mounted unmount it. Detach all other external drives.
Open Terminal and enter diskutil list
to get an overview. You will get a list of all attached drives similar to this one - your output may slightly differ):
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage 121.0 GB disk0s2
3: Apple_Boot Boot OS X 134.2 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *3.0 TB disk1
1: EFI EFI 209.7 MB disk1s1
2: Apple_CoreStorage 3.0 TB disk1s2
3: Apple_Boot Recovery HD 650.0 MB disk1s3
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS Macintosh HD *3.1 TB disk2
/dev/disk3
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *4.0 TB disk3
1: EFI EFI 314.6 MB disk3s1
2: Apple_CoreStorage Encrypted 4.0 TB disk3s2
3: Apple_Boot Boot OS X 134.2 MB disk3s3
/dev/disk4
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *4.0 TB disk4
1: EFI EFI 314.6 MB disk4s1
2: Apple_HFS Data 4.0 TB disk4s2
Now you have to analyze the output. Here disk0 and disk1 are a 3.1 TB Fusion drive with the CoreStorage volume mounted as disk2.
Disk3 is obviously the encrypted disk with deleted data which should be cloned. Disk4 is a spare drive and the target of the clone task. Disk4 has to have at least the same size as disk3! Check this with diskutil info disk3
and diskutil info disk4
.
Below I assume disk3 is the source and disk4 is the target of the clone task. Your disk identifiers may be different (e.g. disk2 and disk3)
Check the device block sizes with
diskutil info disk3 | grep "Device Block Size:"
diskutil info disk4 | grep "Device Block Size:"
Usually the Device Block Size of ≥4 TB drives is 4096 Bytes. If the block sizes of disk3 and 4 are equal you are fine.
Now get the partition tables of the external drives with sudo gpt -r show diskX
. The output should be similar to the one below:
sudo gpt -r show disk3
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 4 Pri GPT table
6 76800 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
76806 976636661 2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
976713467 32768 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
976746235 4 Sec GPT table
976746239 1 Sec GPT header
sudo gpt -r show disk4
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 4 Pri GPT table
6 76800 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
76806 976636711 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
976713517 32768
976746285 4 Sec GPT table
976746289 1 Sec GPT header
Start and size values are block numbers or blocks. Block numbering starts at block 0! In my example disk4 is slightly bigger (50 blocks) than disk3.
First you have to create identical "mirror" partition entries on disk4 (with the same values as those on disk3).
Unmount the target drive:
diskutil umountDisk disk4
Destroy and recreate the GUID partition table (and/or remove an MBR partition table) of the target drive:
sudo gpt destroy disk4
sudo gpt create -f disk4
get an overview of disk4 with sudo gpt -r show disk4
. It should look like this:
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 4 Pri GPT table
6 976746279
976746285 4 Sec GPT table
976746289 1 Sec GPT header
Now recreate the first two partitions of disk 3 with the values of disk3 on disk4:
sudo gpt add -i 1 -b 6 -s 76800 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk4
sudo gpt add -i 2 -b 76806 -s 976636661 -t 53746F72-6167-11AA-AA11-00306543ECAC disk4
This will only modify the GUID partition table (the first 6 and the last 5 blocks) of disk4.
Recheck the partition table of disk4 with sudo gpt -r show disk4
. It should look like this now:
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 4 Pri GPT table
6 76800 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
76806 976636661 2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
976713467 32818
976746285 4 Sec GPT table
976746289 1 Sec GPT header
Now clone the content of disk3s1 and disk3s2 to disk4s1 and disk4s2:
sudo dd if=/dev/disk3s1 of=/dev/disk4s1 bs=1m
sudo dd if=/dev/disk3s2 of=/dev/disk4s2 bs=1m
Clone disk3s3 to a file:
sudo dd if=/dev/disk3s3 of=/Users/user_name/Desktop/bootosx.cdr bs=1m
Replace user_name by your short user name.
Cloning the first partition (300 MiB) is fast (~3.5 seconds). Cloning the second partition (4 TB) will take about 11 hours (USB3/Thunderbolt) or 30-50 hours (USB2).
Unmount the source drive:
diskutil umountDisk disk3
and detach it. Check if the target drive still is disk4: diskutil list
.
add the third partition on disk4:
sudo gpt add -i 3 -b 976713467 -s 32768 -t 426F6F74-0000-11AA-AA11-00306543ECAC disk4
Clone bootosx.cdr to disk4s3:
sudo dd if=/Users/user_name/Desktop/bootosx.cdr of=/dev/disk4s3 bs=1m
After the cloning to the last partition on the target disk is done, you should be asked for the FileVault password.
Don't attach the source and the target drive at the same time on one Mac. They have identical UUIDS for the LVG/PV/LVF/LV (the CoreStorage Volume Group containing the FileVault container) and I don't know if and how they "coexist".
Under these circumstances some partition table values of the target disk (disk3) have to be adjusted and only one of the CoreStorage partitions has to be cloned with dd
.
Unmount the target drive:
diskutil umountDisk disk3
Destroy and recreate the GUID partition table (and/or remove an MBR partition table) of the target drive:
sudo gpt destroy disk3
sudo gpt create -f disk3
get an overview of disk3 with sudo gpt -r show disk3
. It should look like this:
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 7814037101
7814037135 32 Sec GPT table
7814037167 1 Sec GPT header
Now recreate the first and the sixth partition of disk 6 with modified values on disk3. Since the Device Block Sizes of the two disks are different you have to recalculate start blocks and sizes (usually by multiplying with 8):
sudo gpt add -i 1 -b 40 -s 614400 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk3
sudo gpt add -i 2 -b 614440 -s 4882550376 -t 53746F72-6167-11AA-AA11-00306543ECAC disk3
This will only modify the GUID partition table of disk3.
Recheck the partition table of disk3 with sudo gpt -r show disk3
. It should look like this now:
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 40
40 614400 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
614440 4882550376 2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
4883164816 2930872319
7814037135 32 Sec GPT table
7814037167 1 Sec GPT header
Now clone the content of disk6s1 and disk6s6 to disk3s1 and disk3s2:
sudo dd if=/dev/disk6s1 of=/dev/disk3s1 bs=1m
sudo dd if=/dev/disk6s6 of=/dev/disk3s2 bs=1m
Clone disk6s7 to a file:
sudo dd if=/dev/disk6s7 of=/Users/user_name/Desktop/bootosx.cdr bs=1m
Replace user_name by your short user name.
Cloning the first partition (300 MiB) is fast (~3.5 seconds). Cloning the FileVault partition (2.5 TB) will take about 7 hours (USB3/Thunderbolt) or 20-35 hours (USB2).
Unmount the source drive:
diskutil umountDisk disk6
and detach it. Check if the target drive still is disk3: diskutil list
.
add the third partition on disk3:
sudo gpt add -i 3 -b 4883164816 -s 262144 -t 426F6F74-0000-11AA-AA11-00306543ECAC disk3
Clone bootosx.cdr to disk3s3:
sudo dd if=/Users/user_name/Desktop/bootosx.cdr of=/dev/disk3s3 bs=1m
- After the cloning to the last partition on the target disk is done, you should be asked for the FileVault password.
- If you don't get a password prompt, you can mount it by entering
diskutil cs list
and diskutil cs unlockVolume LVUUID
(with LVUUID: UUID of the encrypted CoreStorage volume - in your case probably BE5B9EBC-6DCB-49C5-B055-B00C49864795)
Please add a comment (with @klanomath) if you don't get a password prompt or run into problems.
Best Answer
Sadly you are going to have to get that volume unlocked before you can copy any data from it. The encryption cannot be "cracked" in any reasonable period of time.
If there is corruption, the volume/data may be irretrievable.
Can you find a machine running Lion and try to unlock it one last time there? If that works, copy all the data off the volume and onto a new volume.