- unmount SD card
- resize partition using gparted
- apply changes
using fdisk:
$sudo fdisk -l /dev/sdb
...
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 96453 88262 43.1M c W95 FAT32 (LBA)
/dev/sdb2 98304 8486911 8388608 4G 83 Linux
In this case the important number is the End Sector = 8486911.
>> 8486911 * 512 / 16 / 1024 / 1024
ans = 259.00
>>
So, we are goin to use 260:
umount /dev/sdb1
umount /dev/sdb2
sudo dd if=/dev/sdb bs=16M count=260 | pv | dd of=<image_path> bs=16M