I imaged a 16 GB SD card using the dd command. The card however, does not have more than 4 GB of data on it across 2 partitions (FAT32 & ext3).
I would like to transfer this image on to a 8GB SD card. How do I go about shrinking the image?
Assuming Linux, something like this could be done:
Note: Usually, you have to first shrink the filesystem, then adjust the partition size to match the filesystem. Gparted does this for you in a single "Resize" step, but other tools may not.
First off, you can't just shrink the disk image. There's too much complicated stuff going on inside.
I'm going to suggest you mount the dd image then either copy files across to your new filesystem, or research further on shrinking your specific filesystems rather than the disk.
First off, do you have a copy of the original partition table?
If not, try:
Then hopefully you can use the values in the above to do something like:
(replacing the above capitals as required)
From there, mount the image:
and either copy your data or learn about standard shrinking of your particular file systems and further dd'ing.