Rora P - 2020-01-16

I use a clonezilla script/option in grub to automate restoring a disk image for one of my (unencrypted) OS drives. For some reason the target drive (sdc) was not detected during POST the one time and clonezilla ended up trying to restore to the newly assigned sdc drive (formerly sdd). It threw a GPT/size error before writing the data itself so sdd's contents should still be recoverable (i hope).

sdd contained 5 veracrypt encrypted data partitions of various sizes split over 4TB. These partitions were created with minitool partition wizard and then formatted/encrypted using veracrypt's wizard. the 5 partitions are no longer visible from windows' disk manager and the disk now shows up as an unformatted MBR drive with 2 partitions (2TB & 1.8TB).

Since i panic rebooted before grabbing the actual clonezilla log, here's an approximation taken from an attempt to manually recreate the same conditions of the screwup on a different disk:

Clean filesystem header in device /dev/sdd1...
Clean filesystem header in device /dev/sdd2...
Clean filesystem header in device /dev/sdd3...
Clean filesystem header in device /dev/sdd4...
/dev/sdd4: 4 bytes were erased at offset 0x000001c6 (atari): b9 d3 d8 fa
Clean filesystem header in device /dev/sdd5...
Trying to clean the MBR and GPT partition table on the destination disk first: /dev/sdd
Informing the OS of partition table changes... done !
Non-grub bootloader found on /tmp/sdc-rolling-backup-tmp-cnvted/sdd-mbr...
The CHS value of hard drive from EDD will be used for sfdisk.
Sfdisk >= 2.26 does not support C/H/S option. Skip using C/H/S option.
Error: /dev/sdd: unrecognised disk label
**************************
Tue Jan 7 14:36:24 UTC 2020
Writing the partition table...
No partition table exists in target disk /dev/sdd, try to initialize one so that we can get the disk
 size by parted... Running: parted -s /dev/sdd mklabel msdos
done !
Warning!! Destination disk (/dev/sdd) size is 4.00TB, which is larger than the MBR partition table
 entry maximum 2 TiB (~2.2 TB). You have to use GUID partition table format (GPT).
Press "Enter" to continue......

i cloned the drive to another disk with ddrescue/knoppix and ran testdisk "deeper analysis" on the clone. it did find something but the sizes don't make too much sense to me (but what do i know: i've never used testdisk successfully). Here's the testdisk log on pastebin and this is what i see on screen:

Disk /dev/sdd - 4000 GB / 3726 GiB - CHS 486401 255 63
| Partition | Start | End | Size in sectors
| --- | --- | --- | ---
| >D MS Data | 264192 | 7814035455 | 7813771264
| ]D MS Data | 1973193639 | 1977629664 | 4436026 [~?~IiM-k M-8~6M-#
| ]
D MS Data | 1973193640 | 1977629665 | 4436026 [~?~IiM-k M-8~6M-#
| D MS Data | 4851368994 | 4851771756 | 402763 [
| D MS Data | 4851368995 | 4851771757 | 402763 [

Here are the original partition size approximations as best i can remember them. the last one i feel certain was either 63.7 or 67.3 GB.

sdd1: 300-350 GB
sdd2: 350GB - 1.0TB
sdd3: 1.1-1.3 TB
sdd4: <1.0 TB
sdd5: 62-68 GB

and the grub entry that caused this much:

set isofile="/clonezilla/clonezilla-live-2.6.0-37-amd64.iso"
loopback loop (hd2,5)$isofile
linux (loop)/live/vmlinuz boot=live live-config noswap nolocales union=overlay edd=on nomodeset ocs_prerun=\"mount /dev/sdb5 /mnt\" ocs_prerun1=\"mount --bind /mnt/clonezilla /home/partimag/\" ocs_live_run=\"ocs-sr -e1 auto -e2 -r -batch -j2 -nogui -v -scr -p poweroff restoredisk sdc-rolling-backup sdc\" ocs_live_extra_param=\"\" keyboard-layouts=\"\" ocs_live_batch=\"yes\" locales=\"\" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
initrd (loop)/live/initrd.img

And before you ask, no I did not realize there was such a thing as a veracrypt recovery disk until i googled my predicament. Some help would be appreciated though. Ask away for any clarifications.