Saturday, December 17, 2016

hard drive - Move/Merge non adjacent partitions with dual boot Windows 10 + Fedora 29


My partitions look like this:


image



  • KDE partition manager


image


I want to expand /dev/nvme0n1p7 with the unallocated space between Windows 10 partition and Fedora boot partition; unfortunately, I'm not sure how to solve the problem, even though, I have read a lot of similar questions.


Note: The unallocated space is larger than the partition I want to expand.


Answer



A generic method that works with non-LVM partitions:



  1. Boot from a live CD so that both partitions are unmounted.

  2. Move the p6 "/boot" partition to the beginning of unallocated space.

  3. Now the unallocated space becomes adjacent to p7 "fedora".

  4. Move the p7 "fedora" partition to the beginning of unallocated space.

  5. Now the unallocated space is to the right of p7 "fedora".

  6. Expand the p7 "fedora" partition and its filesystem to the right.


However, this could probably be done fastest by creating a second LVM PV in that space, and letting LVM do the merging. (It won't look very neat in the partition table, but on the other hand, it can be done from the running OS and what's the point of having LVM if you don't use it for anything?)


Note: I have not tested this; it's based entirely on the manuals.



  1. Create an empty partition to claim all the unallocated space.

  2. Add the new partition to LVM using pvcreate /dev/nvme####.

  3. Add the new partition to the main volume group using vgextend fedora /dev/nvme####.

  4. Extend the Fedora logical volume using lvresize --size +147G /dev/fedora/####

  5. Grow the filesystem using resize2fs /dev/fedora#### or other apropriate tool.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...