Just throwing out a few ideas.
Best not to use dd. ddrescue will handle any faults, while still doing a byte-for-byte copy. dd can work for MBR partitions, but not for GPT. In GPT, there are 2 copies, placed on opposite ends of the disk.
The only tool I know that will do a bit-for-bit copy, yet allow restore to a smaller partition doesn't work at the disk level. It works at the partition level. fsarchiver. fsarchiver will capture the file system during the backup and lay down the same file system during a restore. It is more efficient if the tool understands the file system, but it can handle anything at a binary level. savefs is the command option. There's a restfs to go the other way. The manpage has nice examples.
As for creating disk partition tables, you can use sudo parted -ml to capture a current table and use that machine readable output as input to create a partition table on any other disk with the specified sizes and partition types. An example:
Code:
BYT;
/dev/sda:500GB:scsi:512:512:gpt:ATA Samsung SSD 860:;
1:1049kB:538MB:537MB:fat32:EFI System Partition:boot, esp;
2:538MB:1305MB:768MB:ext2::;
3:1305MB:500GB:499GB:::;
sda3 holds a LUKS encrypted container which holds LVM inside with PVs, VGs and LVs.
vgcfgbackup and vgcfgrestore would probably be helpful. I've never used either. My backups are performed above the file system layer.
Here's the sfdisk for the same:
Code:
$ sudo sfdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 20A94340-1AE2-405A-9C90-xxxxxxxxxxxxxxx
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 2549759 1499136 732M Linux filesystem
/dev/sda3 2549760 976771071 974221312 464.6G Linux filesystem
To me, all the interesting stuff is in sda3.
Perhaps there are commercial options. I wouldn't know about those. If they are Windows-centric, they likely wouldn't know anything about LVM or LUKS encryption.