Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

#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 :

  1. bind a loop device to the image: losetup /dev/loop10 $image_file
  2. refresh partitions: partprobe /dev/loop10
  3. adjust partition size: gparted /dev/loop10
  4. undo the loop: losetup -d /dev/loop10
  5. remove unwanted space: truncate -s -${SIZE}G $image_file (you might want to calculate the exact size based on values from fdisk/cfdisk * sector size)

NOTE You might need to double check the partitions' UUIDs, mine seem to have changed and I had to update fstab