Do you know what the error message was during compression?
I'd give it a try without compression.
Also watch the available disk space. In the most excessive case you'd need 2 - 3 times the size of the SD card as free space on your harddisk.
The Shrink/Expand function is based on MBR disks, which typically have the first primary partition being FAT or FAT32 and the second primary (!) partition being EXT.
In this formatting up to 4 partitions can be a primary partition. This used to be the most common way to partition SD cards for the Raspberry Pi.
Recently some have started using a different partitioning scheme (not sure why though), which will not work with the shrink/expand function.
You'd see (on an MBR disk) one FAT or FAT32 primary partition, and one Extended partition (!). The Extended partition then holding 1 or 2 logical partitions (like "sub" partitions inside the Extended partition).
Considering the info you provided, it sounds like you have the right configuration on your disk.
Naturally, "disk2" could be a logical partition residing on an extended partition. (nice and confusing right?)
Note, do not confuse "extended" partition with "EXT formatted partition" - you probably already know this I assume, but if not: FAT/FAT32/EXT are filesystems on a partition.
Where as partitions can be "primary", "extended" or "logical".
This is how shrinking works (to give you a better idea about needed disk space - expanding a partition works in a similar way);
- APB makes a full IMG of the SD card on your harddisk.
- APB tries to determine if the is a primary partition, in the IMG file, with an EXT filesystem.
- If found, APB will copy that entire partition to disk.
- The copied partition will then be shrunk.
- Next APB grabs the original IMG backup, and copies all the bytes up to the EXT partition to a new IMG file.
- After that it will add the shrunk EXT partition to the new IMG file.
- And finally it will add everything beyond the EXT partition, from the original IMG backup, to the new IMG file.
As you can see: this can potentially take up quite a bit of disk space.
Unfortunately, I have not found a way to shrink or expand a partition on the fly 😞