SEARCH

How-To Geek

How to Resize Your Ubuntu Partitions

image

Whether you want to shrink your Ubuntu partition, enlarge it, or split it up into several partitions, you can’t do this while it’s in use. You’ll need a Ubuntu live CD or USB drive to edit your partitions.

The Ubuntu live CD includes the GParted partition editor, which can modify your partitions. GParted is a full-featured, graphical partition editor that acts as a frontend to a variety of Linux terminal commands.

Boot From CD or USB Drive

If you have the CD or USB drive you installed Ubuntu from, you can insert it into your computer and restart. If you don’t, you’ll have to create a new Ubuntu live media. You can download an Ubuntu ISO from Ubuntu.com and burn it a disc by right-clicking the downloaded ISO file and selecting Write to Disc.

image

If you’d rather use a USB drive, use the Startup Disk Creator application, which comes with Ubuntu. You’ll find it in the Dash.

image

Provide the Startup Disk Creator application with a Ubuntu ISO and a USB flash drive and it will create a live USB drive for you.

image

After creating the live media, insert it into your computer and restart. If the live environment doesn’t start, you may have to enter your computer’s BIOS and change its boot order. To access the BIOS, press the key that appears on you screen while your computer boots, often Delete, F1, or F2. You can find the appropriate key in your computer’s (or motherboard’s, if you assembled your own computer) manual.

Using GParted

While the GParted partition editor isn’t present by default on an installed Ubuntu system, it is included with the Ubuntu live environment. Launch GParted from the Dash to get started.

image

If you have multiple hard drives in your computer, select the appropriate one from the drop-down box at the top right corner of the GParted window.

image

Partitions can’t be modified while they’re in use – partitions in use have a key icon next to them. If a partition is mounted, unmount it by clicking the eject button in the file manager. If you have a swap partition, the Ubuntu live environment will likely have activated it. To deactivate the swap partition, right-click it and select Swapoff.

image

To resize a partition, right-click it and select Resize/Move.

image

The easiest way to resize a partition is by clicking and dragging the handles at either side of the bar, although you can also enter exact numbers. You can shrink any partition if it has free space.

image

Your changes won’t take effect immediately. Each change you make it queued, and appears in a list at the bottom of the GParted window.

image

Once you’ve shrunk a partition, you could use the unallocated space to create a new partition, if you like. To do so, right-click the unallocated space and select New. GParted will walk you through creating the partition.

image

If a partition has adjacent unallocated space, you can right-click it and select Resize/Move to enlarge the partition into the unallocated space.

image

To specify a new partition size, click and drag the sliders or enter an exact number into the boxes.

image

GParted shows a warning whenever you move the start sector of a partition. If you move the start sector of your Windows system partition (C:) or the Ubuntu partition containing your /boot directory – likely your primary Ubuntu partition – your operating system may fail to boot. In this case, we’re only moving the start sector of our swap partition, so we can ignore this warning. If you’re moving the start sector of your main Ubuntu partition, you’ll likely have to reinstall Grub 2 afterwards.

If your system does fail to boot, you can consult the Ubuntu wiki for several methods of reinstalling GRUB 2. The process is different from restoring the older GRUB 1 boot loader.

image

Click the green check mark icon on GParted’s toolbar to apply the changes when you’re finished.

image

Back ups are always important. However, back ups are particularly important if you’re modifying your partitions – a problem could occur and you may lose your data. Don’t resize your partitions until you’ve backed up any important data.

image

After you click Apply, GParted will apply all queued changes. This may take a while, depending on the changes you make. Don’t cancel the operation or power down your computer while the operation is in progress.

image

Restart your system and remove the CD or USB drive after performing the operations.

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 05/21/12

Comments (7)

  1. TheFu

    I love gparted. It has saved hours of reloading Windows and other OSes for me. Perhaps days.

    Of course, it is always best to get our allocations correct to start. That usually means:
    * 10GB for the OS if you have a specific purpose (sometimes an entire special use OS only needs 500M)
    * 20GB for the OS if you do not have a specific purpose – most desktops
    * /home on a different partition … not too large – think documents, not video, audio, or virtual machine files.
    * /data on a different partition. This will hold those large files and will be encrypted.

    How do people deal with LVM – Logical Volume Manager – setups? It does not appear that gparted handles that http://gparted.sourceforge.net/features.php .

  2. M Henri Day

    Chris, good and very useful piece ! A minor point, which, however, it might be worthwhile to make explicit : my experience is that the Gparted operation you describe above doesn’t require one to boot from a CD or a USB drive which has the same version of Ubuntu as the one installed on the computer in question. Thus, for example, if one has an old Natty CD in a desk drawer and wants to modify partitions on Precise, the former can easily be used for this purpose – just boot from the CD and follow your instructions above….

    Henri

  3. Murasaki

    Thank you so much for the detailed, step-by-step explanation! Very useful for someone with very limited knowledge of computers like me. :)

  4. Justin

    I agree with m Henry

  5. cam2644

    Thanks for the useful info. I’ve stored it away for possible use in ther future

  6. Wang Xiaoyun

    Among quite a few successful cases, I do have one disastrous instance of using GParted. It was a partition attempt to dual boot so I had 1 NTFS, 2 ext4 and 1 swap partitions. I think I planned the partitions with GParted Live before installing Ubuntu. Most of the operations went through just fine, except I could not squeeze the last few MB into a partition. The whole system was running fine for a few days then one day I could not mount my home directory and both Ubuntu and GParted could not recognize the partition as a valid ext4 one. I ended up creating the home partition from the scratch with all data erased. Fortunately I had a backup of the most important data in an external harddrive.

    I could not figure out the root cause behind it, but version discrepancy of my Gparted Live CD and the Ubuntu is probably one of the candidates. And the weird issue that I had to left a few MB out of the final partition layout also seemed to imply mis-aligned partition border or something related.

  7. Chris Hoffman

    Yes, it’s tough to say — it’s possible that older file-system tools on older versions of Ubuntu could have bugs, so in general it’s tough to say whether the same version is necessary or not. For example, I wouldn’t want to use Ubuntu Warty (original release) to manipulate my ext4 partitions.

Enter Your Email Here to Get Access for Free:

Go check your email!