How to resize my dual-boot partitions
I have a dual-boot laptop with both Windows 10 and Ubuntu 16.04.
Currently, the Windows side has too much disk space, and I want to resize things so that the Ubuntu side has more.
Firstly, I went into the Windows disk management and shrunk the Windows partition by 20GB. I then wanted to expand the Ubuntu partition, but it seemed like this option was greyed out.
Can I expand the Linux partition from Windows or do I need to be in Ubuntu or do I need to create a boot disk and do it that way?
Or do I need third party software?
Any help gratefully received.
Solution 1:
Below worked for me! Please check if this will work for your setup, I cannot guarantee anything.
I had a similar problem. having dual boot W10 and Cinnamon Mint, the diskspace for linux was fully used and I could not start up linux. I therefore had to enlarge the linux partition (EXT4) and reduce the W10-partition(NTFS) at the same time.
I am not an expert and found it a little scary, afraid of disabling both W10 and Cinnamon Mint.
I therfore started to make a backup of all my data on an external HD (data from both W10 and Linux). I made a recovery USB-stick for W10 (from within windows) and looked up how to repair a possibly corrputed GRUB2 form linux. This is because by changing partition sizes one may actually move complete parttitions on the drive and corrupt the startups from both W10 and linux.
Once done my next step was to shrink the W10-ntfs data partition (I had 2 main partitions, one containing the W10 operating system (Drive C:) and one containing the data (Drive D:)). I did this from within windows on the PC. After shrinking restart your PC and confirm windows works correctly and chek if the resize was succesful.
Next step was to create a GParted-iso startup USB stick. This is needed to resize the, non-mounted, linux parttition. Since I already had Linux installed on the PC that is what I needed. Alternatively you can create a Ubuntu live-USB Stick and run it from USB and open Gparted from Ubuntu (if Gparted is included, otherwise installl Gparted from within that live Ubuntu). In order to run the Gparted from USB stick, I needed to change some setings in the BIOS since the USB stick did not show up as boot option i the BIOS: I have a UEFI Bios and needed to disable Fastboot, enable CSM launch otherwise the option of booting from USB stick would not show under the "save&Exit"Tab. (I do not recall anymore if I had to disable secure boot, you may have to do that as well) .Choose the option to boot from the USB stick. Save and exit the BIOS. Please write down your original Bios settings since you have to change back to these once all resizing has been done.
put the Gparted USB stick in the PC and reboot into the BIOS. Choose the USB stick as 1st boot option, save and exit. The PC wil now start Gparted from the USB. within the Gparted program, expand the linux partition (ext4) to the size you need (I extended it with the newly created unallocated space from the W10 parttition shrinkage). save and exit GPparted and remove the USB Stick reboot into BIOS and put everything back to the original BIOS stettings and reboote.
Upon reboot it worked again, I received my usual screen otpion login with Linux or Windows 10 and both worked.
After all I did not need the recovery W10 stick, didn't need to repair the Linux GRUB2 and didn't need to put back my data from both W10 and linux, but hey, better be safe than sorry.
above worked for me! Please check if this will work for your setup, I cannot guarantee anything.
Solution 2:
For your edited question:
I'd do like this:
Be prepared to reinstall ubuntu if anything wrong happens.
You don't need 15 GB of swap space. Take 300 MB from sda6 and combine it with unallocated 694 MB and make that partition swap.(1 GB) Combine balance sda6 (15.88GB (less) 300MB that you have taken in the above step) with sda5 (ubuntu partition) 15GB swap is a waste of space. When you boot to ubuntu, if you don't see the swap partition, reinstall ubuntu or check for any other solutions to force ubuntu to detect the modified swap.
If you combine the space you freed from windows c drive, you will mess up with the position of recovery partition, which might make it not possible to load recovery or diagnostic tools.
I have not tried modifying diagnostic or recovery partition. So I don't know about it. This article https://www.partitionwizard.com/partitionmagic/delete-recovery-partition.html says it is ok to delete recovery partition.
But if you take the swap space, you will get a lot of space for ubuntu. Decrease swappiness setting for better performance. It will force ubuntu to use more RAM and less swap.
Solution 3:
Boot from the usb drive you made bootable to install ubuntu There is a software called gparted in it. If you can't find it, install it from the software centre. Open it and there you can resize partitions. Alternatively, You can download iso file of partition resizing tools like EaseUs , make a USB bootable with the ISO, and boot from it. You can also use Hiren's Boot CD iso. There is a partition manager in Hiren's Boot CD (without booting into mini windows xp mode). If you plan to use mini xp mode, scan and remove viruses from the iso using an antivirus before putting into USB.
If your partitions aren't near to each other, (say, you have a partition used to store movies in between your windows and linux partitions, use the unallocated free space to increase the space of the middle partition. Then shrink the middle partition to get free space on the other end of the middle partition. Then extend the space of ubuntu partition