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:

http://www.raspberrypi.org/downloads

Extract the downloaded archive, and then open ImageWriter:

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!

 

15 Comments

  1. 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!

  2. 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.

  3. 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 !

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

  5. 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.

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

  7. Web Surfer

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

  8. 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.

  9. 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

Trackbacks/Pingbacks

  1. Raspberry Pi + OpenCV | MitchTech - [...] the install of OpenCV. Its a big package with lots of dependencies. You can follow my instructions here.  Once …
  2. [Raspberry Pi] HOW TO - Installation perso sur Debian6 - [...] [...]

Leave a Reply