In Linux Ubuntu mount the card
Check which one is the mounted SD Card:
lsblk
Then go to the directory you want to have backup in and run:
sudo dd if=/dev/sdb of=./raspberry_backup.img bs=4M status=progress
sync # Ensure all data is written before removing the card from the USB
Then swap the card to the new one and clone MAKING SURE that new card is mounted under /dev/sdb by lsblk :
sudo dd if=./raspberry_backup.img of=/dev/sdb bs=4M status=progress
sync # Ensure all data is written before removing the card
Resize partition if needed (in Linux):
sudo apt install gparted
sudo gparted
The do the steps:
- Select your new microSD card (e.g., /dev/sdc).
- Find the root partition (ext4) – this is /dev/sdc2.
- Resize it to fill the remaining space.
- Apply changes and exit.