Move a raspberry pi installation to a bigger micro sd card

Have you ended up with a too small sd card on your raspberry pi? I did. I wish I had used a 32GB instead of a 8GB card. I’ve only got 500MB left, which reminds me that this was the total har drive capacity I had on my 80386 computer when I was 14 years old.

Now, this can be fixed using the dd command on linux and mac (and probably som gui tools on windows). Follow these steps to move your installation to a bigger sd card, but note that your device name might differ from the example as it depens on how you mount your micro sd card:

sudo dd if=/dev/sda bs=1M of=backup-sd-card.img

then insert a bigger sd card and run

sudo dd if=backup-sd-card.img bs=1M of=/dev/sda

Boot up the raspberry pi with the new card and run

sudo raspi-config

Go into “Advanced options” and run “Expand Filesystem”.

Once completed, reboot the system and check the new filesystem capacity with the df -h command.

Excellent, now I can continue to work 🙂

Next article up; make a backup of a raspberry pi installation that is physically hard to get to, but can be reached throught the network.