topamax once a day

Easy GUI Install & Re-Partition Raspberry Pi on Ubuntu

Easy Install & Resize the SD Card on the Raspberry Pi on Ubuntu.

First, open a terminal and install the ImageWriter and GParted utilities with apt-get

sudo apt-get install usb-imagewriter gparted

Assuming you are starting with a fresh install, download the newest release from the Raspberry Pi download site:

Extract the downloaded archive, and then open ImageWriter:


Select the desired .img file and target device, in this case, debian6-19-04-2012.img, and /dev/mmcblk0


Once the image write has completed, the next task is to repartition the SD card.  Note: this process can be done at any later as well, it is not limited to only during initial setup!  In any case, open a terminal, and start Gparted:

sudo gparted

The screen will display the current partition layout on the SD card, notably how much extra space is currently unused, in this case, almost 2GB.

The first step is to delete the swap partition at the bottom of the table  To do this, right click partition 3 (/dev/mmcblkp03) and select delete.  Notice that the operations pending section now displays this change.

Note: If the partitions are locked, they will need to first be unmounted before they can be modified.  To do so, right click on the partition, and select ‘unmount’ (Thanks Anand).

Now, right click partition 2 (/dev/mmcblkp02) and select resize/move.  A pop-up will allow you to configure the partition:

Expand the partition, leaving free space at the end to be used for swap (512 MB below).  Make sure the 1 MB free space preceding doesn’t change, and select None in the Align to box:

Click the Resize/Move button, and you will return to the main screen.  Notice that the operations pending now also shows the grow operation.  Note:  If this displays move and grow, instead of just grow, cancel the operation and try again.

Now we create the swap partition at the end. Right click on the remining unallocated space, and click new.  Expand the partition to fill the maximum available space, and set the file system type to linux-swap:

Click add, and return again to the main screen, which now displays all three pending operations:

If everything looks good, click the checkmark in the header bar to apply the changes, and confirm the pop-up warnings.  Once finished, you will see the final result:

Close out of GParted, and eject the SD card.  It is already unmounted from the partitioning operation. Enjoy the extra space on your Raspberry Pi!


  • Pingback: Raspberry Pi + OpenCV | MitchTech()

  • Perfect. Thanks. Small issue in my case… two partitions were shown locked and therefore could not be resized. Unmounted them and was able to proceed.

    • Thanks for sharing Anand… I added a line to the tutorial above reminding future readers to unmount the SD card before resizing too!

  • Keith A. Hudson

    I received my pi a couple of weeks ago. I’ve spent that time looking for instructions on how to setup an SD card. Lots of people saying it’s easy and then listing a load of terminal commands that got me nowhere! I’m an ubuntu novice (after using windows for years), so the terminal commands are still an alien language. A couple of minutes using your instructions and I now have the image on the SD card.

    Thanks very much.

    • Glad to hear you found it useful Keith!

  • Milan

    Another precondition must be fulfilled before starting imagewritter. The SD card need to be formatted, otherwise it won’t work (the process aborts with error).

    Thanks Michael for very useful step-by-step instructions.

    • The SD card need to be formatted with fat 32 ? I have problems with imagewriter when I try to write the image. The follow error appears:

      dd if=/storage/2013-09-25-wheezy-raspbian.img of=/dev/sdc
      the process dd finished with an error !

  • The latest images don’t have a swap partition … is this still valid?

    • Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files. This method will work with any of these swap options. For more information, the Ubuntu forum has a useful FAQ page about swap here:

  • Is there any way to actually install ubuntu on Raspberry Pi???

    • Not as far as I’m aware. The Ubuntu ARM distribution requires at least ARMv7 CPUs and higher, and unfortunately the Raspberry Pi has only an ARMv6 CPU.

  • Ok. I used this procedure to add one more fat32 data partition.thanks

  • Web Surfer

    Your instructions saved me from having to mess with the command line! Thanks much.

  • Octopus

    Even easier: boot up the pi and type “sudo raspi-config” at the command line. Select expand-rootfs from the menu that comes up. Next time you reboot the sd card will be filled with a single partition. It took my 16G card a couple of minutes.

  • Pingback: [Raspberry Pi] HOW TO - Installation perso sur Debian6()

  • Menna

    sudo apt-get install usb-imagewriter gparted
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package usb-imagewriter
    any idea how to fix this issue

  • Pingback: OpenCV on Raspberry Pi | ♣()