-
Mount the image using another Linux (a Raspberry Pi works).
-
Find the name of the device using sudo fdisk -l (in our case it's /dev/sda)
-
Resize the filesystem
sudo e2fsck -f /dev/sda2
sudo resize2fs /dev/sda2 3400M
-
Resize the partition (it must be larger than the file system):
sudo parted /dev/sda resizepart 2 3450M
-
Boot on the card freshly shrinked.
-
Run raspi-config to expand the partition:
sudo raspi-config --expand-rootfs
-
Halt the system
Copy the image using dd and count:
sudo dd bs=1m count=3500 if=/dev/rdisk2 of=$(date +%F)-poppy-ergo-jr.img