Transfer image on smaller sd card


Die anyone know the way to transfer image (not backups) of system from 32gb on 16gb sd.
The real system size is about 2gb.


What equipment is at your disposal to accomplish this?
You cannot copy an image of a running Linux system if that is what you are asking.
The easiest way is probably using dd but this appears to be a Linux question, off-topic for this forum. It would likely be better asked on a Raspberry Pi or Debian forum.

Raspi with OH.
Not on running, i can stop and copy

With another Linux machine with one or more SD card readers??

With another rapsi (i have 2), with windows machine. Cardreaders are also not problem.

Like I said it is off-topic but a few years ago some on the Pi forum used this.

1 Like

You need a linux machine to reduce the image size. (Because of CPU perfornance and free disk space.)

It may work with the windows 10 embedded ubuntu, but i never tried that.

Thanks, i know about pishrink - but the main question - if i can put this image on smaller card? I am not sure.

That’s the point of pishrink. :wink:

  • A smaller than the original image, yes. You need to resize the filesystem after writing the image to use the full card again.
  • A smaller than the shrunk image, for sure no. But this is obvious.
1 Like

I am successfully cloning my booted SD card to an USB stick with

rpi-clone (see here )

This mirrors the partition table of the SD-Card to the stick and then syncs the file systems with rsysnc.

rpi-clone is capable of reducing the size of the image depending on the ustilisation of the original partitions.

It is only capable of cloning the booted system locally to an USB stick or a card reader.
But in that case you do not need to stop the system.
The clone itself is shrinked in size and bootable.
I have not yet made use of how in detail it treats the cmdline.txt when you clone the booted SD card to a USB stick or vice versa.
I am myself just cloning to another SD-card.
But there are various options for that.

when running from a cron job it might fail.
I found the cron $PATH different to the root $PATH on my system.
So my cron job starts a script “” which first sets the PATH to the values that root usually has and only then starts rpi-clone.

1 Like

Im not very good in linux, could you aim me how can i resize it?

The mult-threaded Linux system always has many processes running with many open files and changing files. That makes it almost impossible to get a full copy of the running system. They may somehow take a snapshot but by the time it is copied, it is no longer the same…

No, i always google the exact commands prior to resizing.

Paragon’s Partition Manager is probably the easiest to use if you’re not savy using Linux. I think even the free community edition can do it.

If not, use the trial version of the Paragon Hard Disk Manager.

That’s not really an openHAB question so you’re better off googling.

An openHAB-like answer though would be:
Install openHABian on the smaller card, use openhab-cli backup/restore to copy your configuration over.