I'm trying to make a backup of a block device (Raspberry Pi sd card) using dd. Command used:
sudo dd if=/dev/sdb of=rpi-backup-image bs=4MB
where /dev/sdb is the unmounted RPi sd card. The amount of data being backed up is multiple gigabytes large and it byte copies the content of the whole disk. However, the actual "used space" (sensible data on partitions) is only two gigabytes. Is there a way to dd only the sensible data? Perhaps some other tool?
Note: I'm not looking for ways to compress the image after it has been dd-ed.