Scenario:
I have dual boot system with Windows 8 and Ubuntu. Ubuntu partition has very less space 15 GB so I was unable to install and run the programs effectively. I had 100 GB free on other partition so I merged that free space into Ubuntu partition. I followed the following steps which worked fine for me without losing anything. (*Pics are for reference)
STEPS:
1. Boot the computer with the Linux live CD or USB.
2. Start GParted in live Ubuntu session, Most of the cases installed , if not than install from software manager.
3. If you have swap partition(s), right click on it/them and select swapoff (Edit: you can skip this as your snapshot does not show any swap used),
4. As Gparted can add the space from space preceding and space following, we need to add the empty unallocated partition ahead of Ubuntu partition.
6. After specifying such move and resize options, from the menu select Edit -> Apply All Operationsor click the apply button in the toolbar. The resize and particularly move option will take a long time depending on the size of the files to be moved. So wait patiently.
7. After creating unallocated partition before the Ubuntu partition you can add those partition as on step 5 &6 to its main partition. You can on the Swap by right clicking on the Swap partiion.
8. You should then be done! Reboot to see if every thing is fine. If something went wrong and you're unable to boot, try boot-repair to fix it.
9. Install Boot-Repair in Ubuntu
Ø connect to the Internet
Ø open a new Terminal, then type the following commands (press Enter after each line):
Ø sudo add-apt-repository ppa:yannubuntu/boot-repair
Ø sudo apt-get update
Ø sudo apt-get install -y boot-repair && boot-repair
10. Launch Boot-Repair from either :
- the Dash (the Ubuntu logo at the top-left of the screen)
- or by typing 'boot-repair' in a terminal
12. It may be that Windows option may not be displayed in Grub. On that case open the Ubuntu and go to Terminal and update the Grub.
sudo apt-get update grub
13. It may be that you are getting window option but on clicking it , new windows comes stating you to repair your window due to some corruption on. If it occurs follow the following steps:
- Insert the live CD or USB for your windows and boot from it by changing boot sequence from your BIOS
- Select to repair the windows and move to the Command line repair mode from the advance option.
- In the command line, type the following command to fix your boot error
bootrec /fixboot
bootrec /rebuildbcd
- Exit from the command line and reboot your computer in normal mode.
14. Hopefully now you might get extended partition without losing your data.