Switching Raspberry Pi to a bigger SD Card

Published on Author Tomas StibranyLeave a comment

I recently came across a situation where some sites on my RPi webserver (well technically OrangePi with Raspbian Jessie), strangely misbehaved.
Long story short, I have used up all the space on the 8GB SD Card which the Pi used so I needed to switch to a bigger one.
But obviously I didn’t want to set up the whole thing from the ground up, so I wanted to find a way to copy the old SD Card to a new and bigger one and resize the partition so the Pi could use the extra space.
Here are the steps.

  1. Create a backup image of the old SD Card
    1.  Find the name of the device for the SD Card
      df -h
      My is disk4.
    2. 1.2 Create backup image
      sudo dd if=/dev/disk4 of=~/sdcard_copy.img bs=1m
  2. Copy the .img to the new SD Card
    sudo dd if=~/sdcard_copy.img of=/dev/disk4 bs=1m
  3. Resizing the new SD Card’s partition
    1. Power on your RPi with the new SD Card
    2. Resize
      sudo fs_resize
      sudo reboot

Leave a Reply

Your email address will not be published. Required fields are marked *