Please do not post a support request without first reading and following the advice in

30GB worth of files (on my card) stored as 62.4GB image (on laptop)?

  • Global Moderator

    That's not how Pishrink works - it cannot resize a running system, but a backup image. You take a backup image, you copy it on another Linux system and you run Pishrink there. You can of course copy the image on an USB disk, attach it to the Pi and run Pishrink on the Pi, but you'll need something to hold the image.

  • I've used 7zip to compress image backups and all the unused space gets compressed.

  • @simpleethat so compress the .iso file on the computer using 7zip into a smaller .iso file and use a program such as win32diskimager to write it onto the card?

  • Well it win32disk imager won't write a compressed file as an image but if you're just trying to back up your card (which is a good idea) it can save some storage space. You just have to uncompress it if you need to reflash your image.

  • @simpleethat Ah, okay. Uncompress and compress and write it. I'm extracting the files now and I'll reply to how it goes, thanks!!!

  • @Nicky_S14 while you're uncompressing anyway, it will have the exact same size as before when it undoes all the compression.

    If you're using the same sd maybe try using a different program to write, it should fit after all.
    You can clean the disk partition using Windows diskpart, which may work for win32img to detect, also administrator mode.

    Ive seen some tutorials for using a oracleVM virtual box Linux to use the pishrink app. But I think you could use cygwin to do that faster. I don't know which img resizer to use.

  • Diskpart:
    Windows native tool for disk volume management.
    In cmd prompt type "diskpart" be careful it's a powerful tool.
    "select disk #"
    "clean" -caution will clear the partition table. accessing files after will be very difficult.

    Or not because it is a different target sd.

    that won't work so >

    cygwin-libraries needed for pishrink;
    coreutils-8.26-2 e2fsprogs-1.42.12-2 util-linux-2.33.1-1

    save as

    cygwin doesn't really have support for loop devices losetup or filesystems parted so you will have to find some work around in the script; like mounting the image in Windows.... so that probably won't work either, however there are other img resize scripts

    that probably won't work either so >


  • @Nicky_S14 I missed the part about you trying to write it to another card. Sorry about that, I thought you were just trying to back it up. Compressing it won't really help your issue.

  • I had the same issue. I made a backup of my 16 gb image and couldn't write it back to the same sd card after formatting. (Somehow it was literally a few bytes too big.)

    So instead of shrinking the image (difficult) I just decided to start using a 32 gb sd card. The image size only expands automatically to the cards size the first time you use it in a every backup I now make is still 16 I have no troubles anymore fitting the image back on my card after formatting.

  • I've saw a method to make a Linux Virtual Machine and try to reduce the filesysystem as shown in this video:

    I'm going to give it a try today, couldn't get any luck with 7Zip as I'm trying to write it onto a new card.

Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.