Nehmulos' Blog

Amateur game dev

Upgrade Raspberry-pi SD-card

Quick way to move your raspberry pi installation to a new (bigger) sd-card.
It worked fine for me (16GB to 32GB different card-manufacturers), but I wouldn’t grantee it.

First shutdown your rasperry-pi and remove the current sd-card. Insert the card into your computer and unmout it (if automounted). Figure out the name of your computer’s sd-card-slot with dmesg (here it’s mmcblk0 make sure you pick the card and not a partition on it like mmcblk0p1).

sudo dd if=/dev/mmcblk0 of=~/rpi-card.bin

Wait for a long time until it finishes coping an image of the old card. Remove the old card and insert the bigger one. All data on the new card will be wiped, so ensure you lose nothing.
Make sure the new card is unmounted before your run this command:

sudo dd if=~/rpi-card.bin of=/dev/mmcblk0

You can append another command to alert you when the writing has finished like this:

sudo dd if=~/rpi-card.bin of=/dev/mmcblk0 && mplayer drowning-pool.ogg

It will copy the exact image of the old card to the new one.
This takes a bloody long time, so make sure your computer is charged and you’ve got something better to do.

Now put the new sd card into your raspberry-pi and boot it up.

sudo raspi-config

pick resize root fs, reboot and that’s it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: