How to clone Micro SD Card

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.

1 Like

I forgot to mention that (I run into the same problem too). Thanks for that and the other suggestions!

1 Like

When I ran a supervised install from my RPi’s SDCard I used this nifty little thing:
GitHub - billw2/rpi-clone: A shell script to clone a booted disk.

Not sure if it’s still working and if/how you’d get it to run in your setup.
I’ve moved to an SSD a few years ago, so I don’t use it any more.

1 Like

@chairstacker Thank you for this

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?

You will probably need to recover from a backup.

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.

I do not have a backup to restore. Have to somehow recover from old sd card

Can you find the directory on the old SD card where configuration.yaml is located?

no, it is in another partition and that is not visible. Only booting partition is visible.

For Windows, you will need Linux Reader to read the SD card

1 Like

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.

@thuva SD Card Copier works every single time, flawlessly

Just used Win32DiskImager to move from a 8GB to a 128GB sd card, works nicely. My card was not corrupted though.

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 was also expecting that I have to take another step to get the full capacity working. But it just woke up like this:
image

1 Like

I tried with Win32DiskImager, but was not able to. It failed reading. So I did a fresh install and then went with a backup using Linux Reader

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 :slight_smile:

“Win32DiskImager” is not “SD Card Copier”