146

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.

Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).

Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.

How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?

0

4 Answers 4

140

(Step 0:) Back up anything really valuable. This is a pretty tried and tested formula but things can go wrong. A power cut at the wrong moment could really ruin your day if you haven't backed up.

  1. Boot to a live CD or live USB drive in "try me" mode.
  2. Load GParted (should be installed by default, you can apt-get it if it's not)
  3. Resize your partitions (right click, click resize, follow the instructions).
  4. Click apply and sit back while it does the job.
  5. Reboot, taking out the USB stick or CD when it tells you to.
4
  • 3
    How about ubuntu server? What are commands?
    – Dr.jacky
    Dec 6, 2015 at 13:25
  • 3
    @Mr.Hyde the same procedure should apply, you should be able to use the LiveCD to perform the edition of partitions for an Ubuntu server installation. Apr 1, 2017 at 22:04
  • This answer is especially helpful when you have only one partition. Because you can unmount and resize the partition in "Try Ubuntu" mode. Feb 21, 2023 at 21:06
  • If you are setting server, cfdisk is a great TUI tool. Apr 28, 2023 at 13:54
88

If you have already installed Ubuntu 12.04, then install GParted with sudo apt-get install gparted.

Launch it using Alt+F2, and typing gparted.

In order to expand the 63GB partition, you must have unallocated space adjacent right to this partition. So first you will have to use GParted to resize a partition above or below your 63GB partition. Refer the following figure:

A GParted session

When you click on resize, a window will open where you can easily drag and resize your partition. Once the free space is made available, resize your 63GB partition just like the above covering that free space.

5
  • 34
    You can't do it from your installed system since the partition will be in use.
    – psusi
    Feb 11, 2014 at 21:19
  • 5
    Good point. He will have to use Gparted from a live CD as Oli's answer suggests. Feb 12, 2014 at 3:21
  • 1
    @harisibrahimkv , Hi,OP is saying GB is alrady Full how can you increase gb ? Feb 21, 2015 at 3:02
  • 1
    Or you could use it on an external partition.
    – KhoPhi
    Sep 16, 2015 at 17:16
  • 1
    I found this also, that I could only expand to the right. That would be handy to know 5 years ago. Good to know.
    – Tomachi
    Mar 29, 2021 at 12:55
30

You can only re-partition unmounted partitions.

I have a GParted live disc ready for things like that. You can find it here: https://gparted.org/livecd.php

Basic features:

  • Create partition tables, (e.g., msdos or gpt)
  • Create, move, copy, resize, check, label, set new UUID, and delete partitions
  • Enable and disable partition flags, (e.g., boot or hidden)
  • Align partitions to mebibyte (MiB) or traditional cylinder boundaries
  • Attempt data rescue from lost partitions

Resizing is explained in the documentation of GParted. In short (the link has some extra information and tips):

Resizing and moving a partition can be performed by a single GParted operation. To resize a partition:

  • Select an unmounted partition. See the section called “Selecting a Partition”.

  • Choose: Partition → Resize/Move. The application displays the Resize/Move /path-to-partition dialog.

  • Adjust the size of the partition. See the section called “Specifying Partition Size and Location”.

  • Specify the alignment of the partition. See the section called “Specifying Partition Alignment”.

  • Click Resize/Move.

2
  • Could you plz give the link of the iso image of gparted there are so many versions and i need a 34bit gui version. Jun 17, 2015 at 1:54
  • Just use the latest *-i686.iso that is linked to by default.
    – JanC
    Apr 19, 2016 at 23:04
10

One way that you can shrink partitions without losing data is by using GParted. A very good application, but be careful with it.

Edit: Boot from a live CD so you will be able to do the resizing. Install gparted with Ubuntu Software center, or any other way (synaptic etc) you prefer, if it isn't already installed.

It will ask you to authenticate when you run it, as it has access to things that can damage your installation badly. Realise that by altering partitions on your hard drive(s) you can potentially stop your system booting completely. As I said, be careful.

It will then search devices it can see and display the partitions on the first one (probably /dev/sda, if not try different devices from the pull down at the top right). You should be able to see that one of them contains your root (/) mount point. When you are sure you have the correct one (the size itself is a good indicator), right-click on that partition and choose Resize/Move (if it is greyed out, you might need to unmount it first (make sure you have booted off a live CD, and not your installed linux system). Reduce the size in the middle (New Size) edit box to what you want (make sure it's still large enough for your system's needs). Click on resize/move, then use the big green tick to apply the changes. If it reports success, then should be able to shutdown the live cd and reboot into your main system.

Edit2: I just googled a tutorial you might look at gpart tutorial

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .