I use Win32DiskImager. I remove the SD card from my RPi4, put it into a USB adapter, plug it into my PC and create an image file of the SD card on my PC. This image file can be written back to a new SD card. Note: the SD cards must be the same size AND you must have enough diskspace on the PC to hold the entire size for the SD card.
I have not tried to make an image of a corrupted SD card; so, I do not know if there will be a read failure when doing this.
I like this. But I have a different way (not better) because I have committed to using only SD cards. See my thought here:
@MaxK you might want to try an SSD just for fun. The whole thing runs like 10x faster. I use a Samsung T7 - it comes with a cable that fits and no additional power source is needed.
I use win32diskimager to back up the card. If you are running Google Drive on your pc, close it or win32diskimager may not start. Also click on read only allocated partitions.
Before I do that I put the card in another pi via an usb adapter so I can run gpartd and shrink the card so I’m not backing up empty stuff. You can expand it back after the back up.
This does not help me. I am able to read only in windows pc not in mac the sd card. I see files there (.dat, .dtb, overlays, etc). In win32diskimager I can not do anything. How to clone the files to another sd card?
Another option is to create a new install on a new SD card and copy the config and storage files from the old SD card over to the new install. I have not done this but there are other post on this forum that describe how to do this.
So I was able to restore ( I think). With Linux Reader I was able to open the SD card partition and find a backup. I installed fresh version and restored. Now if I connect to PI I can see that it is started but can not access with local ip, probably because it was configured with duckdns. Also through duckdns not able. Trying to figure out why.
I had read that when copying to a larger SD card, an extra step may be needed to extend the file system to utilize the full capacity of the target SD card. I would check the 128GB card to see if the full capacity is there.
I guess your SD Card has two partitions on it, a boot partition and the data partition. The easiest way is to use the balenaEtcher tool, I just have cloned my SD card this way on a Win10 laptop.
Please note: Never let windows make any changes on your SD cards !!!
Insert your original SD Card into an external SD Card Reader (USB).
Insert the new, target SD Card into the SD Card Slot on your windows machine
Ignore all windows filesystem messages, just click on no, no, and close :.)
Start the balenaEtcher Tool, select the source SD card and select BOTH partitions !
Select the target SD card, I cloned a 32GB card into a 64GB card, that works fine.
Start “Flash”
The balenaEtcher Tool will copy both partitions onto the new SD card, expand the filesystem and make the SD card bootable.
That takes a while.
When finished, insert the new SD card (the clone) into your PI4 and it should boot and start without problems.
Enjoy your new SD card and even a larger filesystem.
Keep the original SD card as backup for a while … you never know