How can I increase a partition's size? [duplicate]

On my laptop I have Ubuntu 11.10 and Windows 7 in dual boot mode.

I made a partition of 30 GB for Ubuntu but now it's too small and I want to increase this disk size from 32 GB to 100 GB.

This is home my disk looks like:

C Drive - 360 GB
D Drive - 200 GB
E Drive - 80 GB

On the F Drive I installed Ubuntu which contains 30 GB.

How can I increase this partition from 30 GB to 100 GB?

Someone suggested Gpart tool to achiveve this. but there is a risk to lose my Windows or Ubuntu install.


Solution 1:

As suggested, you can boot from a live CD or USB into Ubuntu. Then open the application gparted which will already be present and resize partitions. This can however break your bootloader and might require fixing it.

A better idea is to make a new partition, and move your home directory there so that you have the additional space and Ubuntu partition can be reserved for Ubuntu.

Here are the steps to do that.

  1. Boot from a live CD or USB into Ubuntu

  2. Run gparted to shrink or delete a current windows partition (if you delete E, for example, remember to backup the files in E from inside Windows). Shrinking a partition will not delete any of your files, but backup is a good idea.

  3. Create a new ext4 partition in the empty space

  4. Follow this guide to move your home there

Note:Please don't forget to remove (or comment or edit) old /dev/sda3 in /etc/fstab. Because multiple declaration of volume (such as existing /dev/sda3 ntfs and /dev/sda3 ext4) would be crash your ubuntu

Solution 2:

There are two options:

  1. As @Uri suggests, boot from Ubuntu Live CD and use gparted to remove/shrink "E drive", then move and resize the Ubuntu partition to take the free space. Since Ubuntu partition is the last on the disk, you'll have to move its origin which will break Ubuntu's bootloader - gparted's website contains instructions on how to fix this.

  2. If you're worried about deleting/moving partitions with gparted, you can just convert one of the partitions (your "E drive") to ext4 and either mount it as /home or symlink it instead or somewhere inside your home directory. The 30 gb partition will then be used for system files and the other partition for your documents and stuff.

Solution 3:

Shutdown your computer, place the Ubuntu CD/USB in it. Then restart your computer and boot from CD/USB and start using Gpart tool.