RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

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

    Scheduled Pinned Locked Moved Help and Support
    storagehelpsupport
    13 Posts 5 Posters 682 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Nicky_S14
      last edited by

      Hi,

      I have a 64GB card with 30G used up. Image here: https://imgur.com/a/rdjCxzV

      But, when I read the card into an image, it's stored as 62.4GB. Now I can't get it on my cards.

      Is there a way to reduce the image file size so it's 30GB?

      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        You can use PiShrink to reduce the backup image, but you'll need a Linux system capable of running it. Or you could just backup your ROMs on the PC and use the default RetroPie image to install, restoring your ROMs on the new installation.

        1 Reply Last reply Reply Quote 0
        • N
          Nicky_S14
          last edited by

          Ok. Can I run PiShrink through an SSH connection to my Pi?

          I'm connected to my Pi via SSH and I'll need to make the /dev/root partition smaller, using the command:
          sudo pishrink.sh [-s] imagefile.img [newimagefile.img]

          How will I go about that?

          Thank you!

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by mitu

            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.

            1 Reply Last reply Reply Quote 0
            • simpleethatS
              simpleethat
              last edited by

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

              N 1 Reply Last reply Reply Quote 0
              • N
                Nicky_S14 @simpleethat
                last edited by

                @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?

                1 Reply Last reply Reply Quote 0
                • simpleethatS
                  simpleethat
                  last edited by

                  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.

                  N 1 Reply Last reply Reply Quote 0
                  • N
                    Nicky_S14 @simpleethat
                    last edited by

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

                    EfriimE 1 Reply Last reply Reply Quote 0
                    • EfriimE
                      Efriim @Nicky_S14
                      last edited by

                      @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.

                      EfriimE 1 Reply Last reply Reply Quote 0
                      • EfriimE
                        Efriim @Efriim
                        last edited by Efriim

                        Diskpart:
                        Windows native tool for disk volume management.
                        In cmd prompt type "diskpart" be careful it's a powerful tool.
                        "list"
                        "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
                        cygwin-libraries needed for pishrink;
                        coreutils-8.26-2 e2fsprogs-1.42.12-2 util-linux-2.33.1-1

                        save as pishrink.sh

                        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 >

                        ???

                        1 Reply Last reply Reply Quote 0
                        • simpleethatS
                          simpleethat
                          last edited by

                          @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.

                          1 Reply Last reply Reply Quote 0
                          • BobHarrisB
                            BobHarris
                            last edited by BobHarris

                            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 Pi..so every backup I now make is still 16 gb..so I have no troubles anymore fitting the image back on my card after formatting.

                            Pi 3B , 64 GB Sandisk ultra flashdrive, 19 systems, 872 hand picked classic gaming gems :-) Dual shock 4v2

                            1 Reply Last reply Reply Quote 0
                            • N
                              Nicky_S14
                              last edited by

                              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.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post

                              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.