How do I perform a simple expansion of my main partition /dev/sda1 while keeping my swap partition /dev/sda2/dev/sda5 the same size? And why is the swap a separate device within the second partition?

I'd prefer to do everything via the command line, but it looks like the more common and easier way is to use gparted.

enter image description here


/dev/sda2 is a logical partition. It works a bit like a container for other partitions. That is why /dev/sda5 is "within" /dev/sda2.

In order to expand /dev/sda1, you need to have contiguous unallocated space to expand into. This isn't possible with your current configuration. What you need to do is move the swap partition to occupy the last 8GB of the disk, and then expand /dev/sda1 to fill the unallocated space in the middle. If you right click the swap partition, there should be an option called swapoff. This will unmount the swap space. You must unmount the swap space before you can make any changes to it. Then you should be able to move the swap partition to fill the unallocated space at the end of the drive, leaving unallocated space in the middle. You can remount the swap space by right clicking on it and selecting swapon. Then you can expand /dev/sda1 to fill the unallocated space.

| improve this answer | |

You should be able to grab the edge of the partition sda1 and increase as much as you like within the available unalocated space.

| improve this answer | |

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.