Hi, recently I installed Manjaro XFCE on my Raspberry and I like it very much. This is my first Linux experience
After I customized Manjaro to my needs, I’d like to create an image out of the SD card so I can use it anytime later with my changes already included, but…
How to create SD image of the size of real data included (and not the size of the entire SD card capacity) ?
How to make the image’s filesystem self-expandable on first boot so I can write it on any SD card and use its full capacity again?
I have been doing this manually with Win 32 disk imager (running on Windows) to write an image file to
my large USB file system, the image file is the same size as the SD Card, 64 GB for example.
Then use Pi Power tools (running on Pi) to shrink the image down to less than 10 GB in my case.
The 10 GB image can then be flashed to any other SD Card greater than 10GB.
Then boot the Pi using this other SD card and once up and running use gparted to expand the running FS to fill the SD Card. Some Linux distros do auto resize, e.g. Ubuntu MATE.
I would love to exclude having to run Win 32 disk imager on Windows but all suggested methods that I have tried using dd on linux do not work.
I did something similar and at the end I created .xz archive which you can use with Raspberry Pi Imager or Balena Etcher directly without a need to unpack it first.
But still, creating an image out of real files only and including a resize script would be a neat solution.