1

The attached screenshot shows my situation. I extended the virtual drive of my VirtualBox machine with one extra GiB, and now I would like to extend the sda1 partition with that extra space.

But I can't because of the extended partition in the way.

Is it possible to somehow overcome this problem?

enter image description here

7
  • 1
    Make the extended partition smaller first, make sure swap partition isn't mounted.
    – phk
    Oct 27, 2016 at 21:20
  • Thank you for the tip. Since I needed a quick fix, I ended up deleting the partition all together since gParted is unable to unmount. And it all still worked :) all good. Oct 27, 2016 at 21:50
  • 1
    It is able to unmount, and it wasn't mounted in your screen shot in the first place. You wouldn't be able to delete it if it was mounted, at least not without having to immediately reboot. In the future, just expand the extended partition to the right, move the swap partition to the right, then move the start of the extended partition to the right.
    – psusi
    Oct 28, 2016 at 0:16
  • @phk, it can't be made any smaller since it is entirely filled by the swap partition.
    – psusi
    Oct 28, 2016 at 0:17
  • @psui: Right, first the swap partitions needs to be unmounted, then resized, then the extended one made smaller.
    – phk
    Oct 28, 2016 at 0:28

1 Answer 1

1

The extended partition can't be changed unless its inner partitions are changed first. In your case the swap partition is in the way, which you would have to resize (or simply just delete it in your case, you can easily recreate it or use a swap file instead).

A common problem is that the swap partition can't be moved/removed because it's still mounted and used, in such a case you need to turn off that it's being used as a swap partition (e.g. using swapoff), no reboot required.

(It might be also worth noting that the extended partition stuff is not needed anymore when using the GPT partition scheme instead of MBR. Note that GPT is commonly used in conjunction with UEFI, whose support in VirtualBox used to be quite lacking, but from what I heard it improved in more recent versions.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .