Found [[https://superuser.com/questions/1343561/is-there-a-way-to-dd-multiple-partitions-into-one-raw-image-file-in-such-a-way-t/1343575#answer-1343575|this]] way to take an image of just the partitions and not the empty space at the end of the disk: * Run "fdisk -l" on the device. * Make sure the units are set to sectors (they are by default in recent versions of fdisk) * Read the end sector of the last partition. * Add 1 * Divide by 2048 to convert to megabytes * Round up to the nearest whole number (better to copy an unneeded sector than not copy sectors that are needed) dd if=/dev/sdX of=filename.img bs=1M count=