Introduction
This post originally concerned a bug in Jaunty which created a partition which was too small to support a normal Ubuntu installation. Since Jaunty reached it's End of Life in October 2010, I am removing the section which details how to identify the bug and correct it. The information on how to expand the Ubuntu / partition remains valid an is left here to help those wishing to enlarge it.
Note for Wubi Users: This guide cannot be used to resize a Wubi installation within Windows. For guidance on how to transfer a Wubi installation to it's own partition, please refer to this link or the WubiGuide.
Do I Need More Space for My Ubuntu Installation?
Check your free space and system partition size by running the following command from a terminal. To open a terminal: Applications > Accessories > Terminal.
Look for the " / " Ubuntu system partition and check the percentage in use. The original figures were for the Jaunty bug, which now is irrelevant. However, even on recent installations, look at the percentage in bold. If it is near 100%, you are running out of room.Code:df -h | grep "/dev/sd"
It is telling you that the Linux system ( / ) is only 2.3GB in size and is 100% full. That partition is too small to run Ubuntu effectively. Although this guide is written to help users with an initial installation that created a system partition that is too small, it can also be used to expand any system partition which has become too small.Filesystem Size Used Avail Use% Mounted on
/dev/sda5 2.3G 2.3G 0 100% /
If you have a system partition which has performed reasonably well in the past but suddenly appears full, you may want to investigate why your system partition is now full: RecoverLostDiskSpace.
Gparted provides an excellent graphical depiction of your system's partitioning. You can also inspect the drive's partitions via terminal commands. After entering the following command you will be asked for a password. Type your password. You won't see it as you type. Press ENTER when you have typed it.
I Need More Space. What Are My Options?On a Windows installation, you will normally see the Windows partition or two, an extended partition, the Linux partition, and a swap partition. This is a typical layout:Code:sudo fdisk -l # Lowercase L, not a number.
In this case, sda1 is a Windows rescue partition, sda2 is the Windows partition (HPFS/NTFS), sda3 is the Extended partition, sda5 is the Ubuntu installation, and sda6 is the Ubuntu swap partition.Device Boot Start End Blocks Id System
/dev/sda1 1 1321 10606592 27 Unknown
/dev/sda2 * 1321 30076 230971576 7 HPFS/NTFS
/dev/sda3 30077 30401 2610562+ 5 Extended
/dev/sda5 30077 30379 2433816 83 Linux
/dev/sda6 30380 30401 176683+ 82 Linux swap / Solaris
- Expand the existing / partition (instructions below).
- Reinstall the system and use a larger partition.
- Move $HOME to a another partition. Here is one link on moving your $HOME partition
- Move your data/music/other files to a non-system partition. On a normal Ubuntu installation the system files should occupy less than 10 GB of disk space.
Some Basic Rules for Expanding the / System Partition:
- Backup your important data (from all partitions).
- If you are going to change the Windows partition, defrag it at least once.
- I recommend using the Windows partition with a Windows partition manager. gparted is an excellent tool but if you are already comfortable with a Windows partitioner, use it to change the Windows partition. Use the Windows Disk Management tool for windows partitions if at all possible for the Windows partitoons.
- Run gparted from the LiveCD/Installation CD or a SystemRescue CD. You must do this because the Ubuntu system partitions must be unmounted to change them.
- To access gparted from the LiveCD: System > Administration > Partition Editor.
- If you are shrinking Windows, leave it some extra space. Don't resize it all the way to the minimum - leave some free space within the Windows partition.
- Unmount any swap partitions (linux-swap). A swap partition is mounted by default on the LiveCD and must be unmounted. Select the swap partition, then from the main gparted menu: Partition > "Swapoff". If you see "Swapon", the swap partition is already unmounted.
- No partitions you are trying to change should be mounted. Mounted partitions have a "keys" symbol in the lower section of gparted.
- When expanding partitions, the unallocated space must be touching the partition you want to grow. There cannot be any other partitions between the two.
- Both the unallocated space and the partition to be expanded must be in the same area - both inside the extended partition, or both outside the extended partition. The extended partition has a light blue border. In the simplest terms, there can be no light blue line between the two partitions or unallocated space you are working with.
non-adjacent.png- When resizing a partition, do not make it smaller than the data currently contained on it. Data is shown in yellow. If you move the borders into the yellow area you will lose data.
- If deleting a partition in the extended partition, all partitions with a higher designation must be umounted first. If the system partition has a higher number than the one you are trying to delete you will need to use the LiveCD or another utility CD so you can umount the system partition.
- Resizing a large partition can take a long time - more than an hour or longer. The bigger the partition, the longer the time. Don't stop the operation until it completes.
When asking for help, a gparted screenshot is very valuable. To take and post a screenshot:
From the Ubuntu Main Menu: Applications, Accessories, Take Screenshot. The screenshot by default is saved on the user's Desktop. To add it to a post, at the bottom of the post page is a section called "Additional Options". Click on "Manage Attachments", browse to the snapshot location and add the screenshot.
How Large Should My Ubuntu Partition Be?
This is highly subjective and depends in part on how much free and unallocated space you have available. The current absolute minimum recommended system partition size is 4GB. The recommended minimum is 8GB.
Providing the Ubuntu partition with more space will give the user more options for growth or future partitioning changes. These options include creating a separate /home partition, making one or more data partitions, etc. Remember that it is much easier to split a large partition than it is to grow one!
Purely subjective, and without knowing the details of your system, I'd use a 10-15GB / and a 2GB swap partition. The 10-15GB should be expanded by the amount of data/music/etc you intend to store in your $HOME folder, unless of course you have a separate /home partition. So if you intend on keeping 30GB of music files in your $HOME folder, the size of your Ubuntu partition should be 40-45GB minimum.
Expanding the / Partition: Step by Step
A few stipulations about these steps:
- The screenshots are not of an actual system. Do not use the partition sizes or designations in the graphics when resizing your partitions. They are only abstract examples and are not proportional.
- The following steps assume you have read and followed steps 1-10 above, including backing up your data, running gparted from a LiveCD, unmounting the partitions, and turning off swap.
- For this example, we will assume the original partitioning is:
- sda1 - Windows recovery partition.
- sda2 - Windows.
- sda3 - Extended partition.
- sda5 - Ubuntu system / partition.
- sda6 - Ubuntu swap partition.
- Here is a screenshot of a typical drive following an Ubuntu installation on a Windows computer. Note this is not a Wubi installation.
original-.install.png
Note the Windows recovery partition is full, the Windows partition has lots of free space, the Ubuntu partition is contained within the extended partition and is full or nearly so.
- Shrink the Windows partition (sda2):
- Note: Reducing the size of the Windows partition is best done using Windows software. If this is not possible or desired, use the following steps.
- This YouTube video shows how to do it, Start at the 4:55 mark. (Thanks to Robster2 for providing the link.)
- Select the partition and from gparted's main menu, select "Partition > Resize".
- Slide the right border of the Windows partition to the left. How much is up to you but remember the Ubuntu partition must be at least 5GB.
- Select sda3, the Extended partition. It is easier to select this partition from the list in the lower pane. shrink-windows.png
- Drag the left border (light blue) of the Extended partition to the left, touching the Windows partition and leaving no unallocated space (gray). expand-extended.png
- Select the Ubuntu / system partition.
- Drag the left border of the Ubuntu partition all the way to the left. The Windows partition and Ubuntu partition should now be next to each other, divided by the Extended partition's light blue border. final.png
- Confirm the Ubuntu partition is now the desired size.
- Hit Apply.
- This operation could take more than an hour to complete, depending on the partition sizes.
- Do not interrupt this process. It could result in data loss.
- If using a laptop on battery, make sure it is sufficiently charged to complete the operation before the battery depletes.
Related Links:
Resizing Linux partitions by srs5694
Installation/SystemRequirements
SOLVED: 2.5 GB System Partition - What Went Wrong?
HowtoPartition
Partitioning Basics
Troubleshooting:
RecoverLostDiskSpace
Disk Full - Check Your Trash
Launchpad Bug Report
Bookmarks