How to resize Ubuntu & Windows partitions? [duplicate]

I've set my grandson's laptop to be able to dual boot (Vista and Ubuntu). I'd like to give as much space as possible to Ubuntu as Windows isn't used much. I'm pretty noob to Linux and have no real idea how to use gparted.

Here is a screenshot of gparted; it'd be great if someone could explain what it means and how to give more space to Ubuntu and less to Windows.

gparted screenshot


Solution 1:

This is what to consider before we can change partition size:

  • Changing partitions always bears a risk of data loss. Therefore backup all valuable data.
  • Only partitions that are unmounted can be altered, i.e. work on a live session (boot Ubuntu "Try out").
  • Ubuntu does not need much space (30 GB) but knowing that the other OS is Vista it may really be better to give Vista as little space as possible but not too small (or remove it entirely if you grandson agreed).
  • Ubuntu needs two partitions at least (root partition /, and swap) but it can handle more if needed. Some people recommend a seaparte HOME partition, which eases distribution upgrades and backups.
  • Swap needs to be in a single partition with no holes. It is therefore in the way when you enlarge your NTFS partition to hold Ubuntu.
  • Windows must not be hibernated.
  • We can only have 4 primary partitions in an MSDOS partition table. Make extended partitions to hold Ubuntu.

From your present partition layout it appears that the root partition for Ubuntu is a bit too small, and the swap partition is in the way of increasing your root partition.

It is possible to add a swap partition later but this may be too complicated for a first start into the Ubuntu universe.

Let me therefore recommend that you

  1. Backup all valuable data
  2. Delete and remove your existing Ubuntu partitions (this will delete all data in them!)
  3. Resize (shrink) the Windows partition (to the right side) according to the excellent answer you already have (but you may have to repair your filesystem from a Vista CD), or from Windows. Shrinking may need a defragmentation first.
  4. Re-install Ubuntu to the now sufficiently large unpartitioned space you will have gained in step 3.
  5. On re-installation of Ubuntu take care to select the unpartitioned space for installation of /, swap, and if applciable /home on "Do something else", or let the installer automatically do this for your by choosing "Install alongside of Windows".

Solution 2:

It's pretty simple. What you're going to want to do is start up gparted (via Alt+F2 and then entering gksudo gparted - you'll have to enter your password.)

Then, select the NTFS partition. My system has an NTFS partition, even though it's not quite set up the same way the screenshots and steps still apply.

  1. Select the NTFS partition:

    ntfs partition

  2. Click on the Resize button (arrow pointing to the right):

    resize

  3. Resize the partition to the desired size and then click Resize/Move:

    resize window

  4. Accept the changes once you've made all the adjustments you want:

    accept

The commands necessary will run and you should, aside from any non-normal occurrences, have the system you want.

Note: You may have to run some commands from the Windows installation disk to repair any system-level changes the resizing might have caused.