Resizing the Raspberry Pi SD card

28 Nov 2012

Yesterday I finally got my raspberry pi from RS.
Due to the (very) long wait they upgraded it to a 500MB version instead of the ordered 256MB.

I also got a 4GB SD card with the OS pre-installed on. After a apt-get upgrade I noticied that I was out of diskspace. It seems that even though they ship the SD card on a 4GB SD card they have only installed the diskimage on 2GB and the rest was left unallocated. Weird.

It is rather simple to fix this if you have a Linux running computer with a SD card reader laying about. As it happens, I have just that. This is how you go about resizing the disk image.

First insert the SD card in the reader and start gparted (if you haven’t got it and you are running a debian distro simply apt-get install gparted).

REMEBER TO BE CAREFULL AND ALWAYS BACK UP YOUR DATA BEFORE PLAYING WITH GPARTED

It will look something like this (this is from the official gparted repository).

Select in the upper right list your SD card. Then you will see a list of about four rows. On of these is a ext4 file system. Right click and unmount this if your OS has mounted it already.

When this is done right click the ext4 row and press “Resize/move”. A new window will pop up. Here you can increase the size to what you desire, either by dragging the line on the right or by manual input in the boxes.

When this is done you now have to commit the changes you have made by pressing Edit in the menu and Apply All Operations.

Now you are done! Eject the SD card and insert it into your Raspberry pi and boot it up.

For inspiration on what to do with your newly bought raspberry pi I suggest that you check out my blog post were I built a automatic watering system or why not make it into a nice little svartkast?

Also note that it is possible to do this from the raspbian boot menu now, check the end of this video.

blog comments powered by Disqus