How can I expand partition?

Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or loose data.

The use of an extended partition (sda3) makes this a little difficult. I'll outline the easiest way first, and we can add more to the procedure if we have to.

Keep these things in mind:

  • a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor

  • a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor

  • if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)

  • you begin any move/resize by right-clicking on the partition in the lower part of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window

Do the following...

Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

  • boot the a Ubuntu Live DVD/USB
  • start gparted or run the following command to open gparted:

    sudo -i gparted &
    

Step #1

  • right-click on sda5 and select swapoff
  • right-click on sda3 and select resize
  • resize the left side of sda3 all the way to the left
    • it may be difficult to grab the left side of sda3, if so, STOP here
  • you'll see that the unallocated space is now used by sda3
  • close the move/resize window
  • click the Apply icon

Step #2

  • right-click on sda5 and select swapoff (already done in Step #1)
  • right-click on sda5 and select move
  • note (write down) the numeric partition size before the move
  • move sda5 all the way to the left (inside of sda3)
    • be carefull not to resize sda5. If you do, cancel and start Step #2 again
  • close the move/resize window
  • click the Apply icon

Step #3

  • right-click on sda6 and select resize
  • resize the left side of sda6 all the way to the left
  • close the move/resize window
  • click the Apply icon
  • this may take a while so be patient
  • right-click on sda5 and select swapon

Now quit gparted and reboot your computer, being sure to remove the USB flash pen at the appropriate time.