is there a possibility to create a backup of the SD card while shrinking it to a smaller card?
I currently have OSMC installed for my RP3 on a 128GB card, but the installation is only using a portion of that size. I want to have a second card ready in case my card crashes. But unfortunately I only have a spare 64GB card and not a 128 GB card.
I tried to shrink the image that I created under Windows with “Win32DiskImager.exe” with the PiShrink script which I found on github but it did not really work. The image was too big for the 64GB card.
This time it worked just fine and the result was a 11 GB image which I copied to the backup SD card. The issue last time was that I worked with a source image that was accessed via a share instead of being on an ext4 formatted drive.
But I still have one challenge which I need to solve. How to extend the OSMC installation to the full size of the sd card? After flashing the image to the sd card with balenaEtcher OSMC is starting just fine and everything seems to work, But OSMC is not using the full size of the SD card
How can I extend the /dev/mmcb1k0p2 to the full size of my 64GB sd card?
Well not sure why using the Gparted ISO instead of the Debian image would be overwhelming especially as Gparted would give you a one stop solution to your shrink and extend issue.
Also no need to use the SD card image with virtual box just give the USB card reader to the VM.
Maybe I was a bit brief. My answer was not to your question about shrinking but a complete answer to your original question. My osmc-restore script runs on the RPi itself and will format the back-up SD card. You just follow the prompts.
But it looks like you’ve found a solution already.
yes I did not really knew what to do with a live linux. Meaning how to then create a image of the SD card. That’s why I created the image under Windows and did the rest as I wrote above.
Yes for linux experts it might look like I spent way to much time and additional steps, but it worked.