2

I am currently dualbooted between Windows 8 and Linux Mint 18

Using GParted, I see this following: enter image description here

The selection partition is unallocated for a size of 25 GB, I would like to merge this with my dev/sda6 (linux partition), so that I can make my linux partition about 50GB. I'm not really sure about the process though on how to do this? I try to resize dev/sda6, but I see that the maximum size and minimum size are the same. How do I merge the unaccolated space? enter image description here

  • 3
    Partitions can't use non-contiguous space, so first you'll need to move the partitions adjacent to it over and make the space contiguous. You might have to do this from live media, as it could very well prevent you from doing this while the partitions are in use – Fox May 7 '17 at 16:42
  • I don't understand what you mean by 'contiguous'? I have Gparted installed from a USB stick, and so what should I do next? – K Split X May 7 '17 at 18:00
  • The free space is separated from the Linux partition — there is another partition between them. You need to move that intervening partition to the end, so that the free space is right beside the partition you want to enlarge – Fox May 7 '17 at 18:04
  • Yes I read about this but how exactly do I "move" a partition? – K Split X May 7 '17 at 22:07
2

The free space and your existing Linux partition are not contiguous, so you can't simply merge them. Linux's own partition scheme, LVM, allows a filesystem to be split between separate location on the disk or even between disks. But native MBR or GPT partitions have to be a single contiguous area.

Moving the partition in the middle would be complicated because there isn't enough space for a non-overlapping move. Unless you move it to another disk and then back, I recommend switching Linux to use LVM, which has other benefits as well.

The tool blocks (formerly lvmify) by Gabriel can convert an existing partition in place. Run it from a live CD/USB.

blocks to-lvm --vg-name=mint /dev/sda6
lvrename mint sda6 root

This will make your system unbootable, so you need to do one more thing before you reboot. Mount the volume and get ready to run commands in Mint via chroot:

mkdir /media/root
mount /dev/mapper/mint-root /media/root
mount --rbind /proc /media/root/proc
mount --rbind /dev /media/root/dev
mount --rbind /sys /media/root/sys
chroot /media/root

Run update-grub and update-initramfs. Now your system will have the necessary drivers at boot time to boot from LVM.

You can now reboot to your Linux installation and add more space to the LVM volume. Create a partition /dev/sda8 encompassing the space you want to use. If asked for a partition type, select LVM physical volume. Then run the following commands to add the space to your root partition.

pvcreate /dev/sda8
vgextend mint /dev/sda8
lvextend mint/root /dev/sda8
resize2fs /dev/mapper/mint-root
  • Neat, I didn't know there was a tool that could convert to LVM in place, however, gparted can just move the ntfs partition to the right, though it will take quite a while as it is rather large, and if interrupted, will trash all the files in that partition. – psusi May 8 '17 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.