Truncate 2 partitions image
sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' ### RUN THE "DISC" software and resize partition using the gui fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE (END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13