Operation Manual
Chapter 5: Partition Management
Having the Raspberry Pi’s operating system provided as an image of somebody else’s SD card is convenient, but a little
inflexible. Most distribution images available for download assume a 2 GB or 4 GB SD card, meaning that people with 8 GB or
larger cards find much of their space wasted.
Creating a New Partition
One way to make the most of a large SD on the Raspberry Pi is to create a new partition in the empty space at the end of the
card. This partition can be used to store any large files that you want your Pi to be able to access without having to use an
external storage device.
All the tasks required for this can be carried out directly on the Pi, without having to remove the SD card and connect it to a PC.
All you need is an SD card flashed with one of the Raspberry Pi Linux images (as described in Chapter 1, “Meet the Raspberry
Pi”) and some free space.
When using tools that can modify the partitions on a disk, it’s important not to delete any existing partitions. In particular, be careful not to delete
the /boot or root file system partitions, or the Pi will be unable to load.
Follow these steps to create a new partition on an SD card:
1. Open a terminal window, and type sudo fdisk -l to list the storage devices connected to the Pi and their current
partitions. The SD card will appear as /dev/mmcblk0 with a series of partitions numbered p0, p1 and so on.
2. Load the cfdisk menu-based partition management tool by typing sudo cfdisk /dev/mmcblk0. This will use the SD
card as the target device. If you’re trying to create a partition on a USB Mass Storage device, replace mmcblk0 with the
device identifier for the storage device (for example, sda).
3. Using the cursor keys, move the partition selection highlight—which prints the currently selected partition in inverse video,
typically black on white—down the partition list to the section labelled Free Space at the bottom.
4. Again using the cursor keys, move the option selection highlight, located at the bottom of the screen and displayed in
inverse video, right to the New option and press Enter (see Figure 5-1).
Figure 5-1: Creating a new partition using cfdisk
5. You will be prompted to create a Primary or Logical partition. The default is to create a Primary partition, so just press