...
#user@localhost:~/u-boot$ make ARCH=arm CROSS_COMPILE=${CC} DEVICE_TREE=stm32mp157c-dk2 all
How do I resize a partition on an img file?
I have a puppy linux img that is 8gb but I need it to fit on a 6gb drive. How do I resize the ext2 partition on the img?
NOTE Make a backup, anything can go wrong ... I ran all those as root :
- bind a loop device to the image:
losetup /dev/loop10 $image_file
- refresh partitions:
partprobe /dev/loop10
- adjust partition size:
gparted /dev/loop10
- undo the loop:
losetup -d /dev/loop10
- remove unwanted space:
truncate -s -${SIZE}G $image_file
(you might want to calculate the exact size based on values fromfdisk
/cfdisk
*sector size
)
NOTE You might need to double check the partitions' UUIDs, mine seem to have changed and I had to update fstab