4

I have a Ubuntu server where my boot partition needs to be expanded:

GParted partition view

The server is virtual and running on VMWare. I have booted from the GParted LIVE CD (version 0.27.0) but GParted doesn't let me resize the partitions.

If I understand correctly I need to move some of the 4GB unallocated space (equal to the size I would like to expand the boot partition with) so it is located just right of the boot partition.

The yellow locks in the image appearently means that the partition /dev/sda5 is mounted, but I don't understand by who and why - since I'm booting from a LIVE CD.

Calling sudo umount /dev/sda2 or sudo umount /dev/sda5 just tells me that they aren't mounted:

Unmount LVM partitions

GParted allows me to click deactivate on /dev/sda5 but it doesn't change anything:

Right click menu with deactivate option

In the end I would like to expand /dev/sda5 to take up the remaining unallocated space, but the first step is to expand the boot partition.

How can I expand the boot partition?

Chau
  • 433

4 Answers4

2

I faced the exact same problem, came across this post, and solved it. I did the following with a 16.04.3 live CD:

  1. Used KDE Partition Manager to expand /dev/sda2 to the end of the drive

  2. Used KDE Partition Manager to move /dev/sda5 to the end of the drive

  3. Tried to use KDE Partition Manager to squeeze out the empty space on the left side of /dev/sda2, but failed. It wanted to first move /dev/sda2 to the right and then chop off an equal amount of space from the right side of /dev/sda2 but there was no room on the drive to do so.

  4. Used gparted to squeeze out the empty space on the left side of /dev/sda2.

  5. Used gparted to grow /dev/sda1 and occupy the whole space.

It worked without updating grub.

Notes:

  1. /dev/sda5 is encapsulated by /dev/sda2 so you can't move or expand /dev/sda5 without making changes on /dev/sda2 first.

  2. You may try to move /dev/sda2 directly to the right. I should have tried it before expanding /dev/sda2.

  3. I used KDE Partition Manager first because I was convinced that gparted doesn't support LV, but now I doubt it because I can activate/deactivate LV with gparted, and I will try gparted for the same operations if I have the chance in the future.

Update:

I recreated the scenario in a virtual machine and tried gparted from 16.04.3 live CD. Now I can confirm that the whole procedure can be done solely by gparted, but I can't move /dev/sda2 directly to the right.

1

GParted does not support resizing LVM logical volumes. It doesn't even see them. Only resizing of LVM PVs is supported. KDE Partition Manager 3.0 can resize them.

You can try Neon Live CD (https://neon.kde.org/download).

Install KDE Partition Manager using sudo apt install partitionmanager KDE Partition Manager can resize LVM PVs that are members of LVM VG.

Here is a short video demonstrating how LVM resize capabilities : https://www.youtube.com/watch?v=FKCQ7pJN1vY

  • Why should I resize the LVM partition? I just want to resize the boot partition. – Chau Dec 07 '16 at 13:21
  • You mentioned in the question that you would like to resize /dev/sda5 later. Well, you first need to move your extended partition (containing LVM PV) to the right a bit, so that there is some free space where you can resize your boot partition. Oh, and you need to deactivate your LVM VG before you can proceed with this sudo vgchange -a n imapwms -vg (Note KPM 3.0 can actually deactivate it from the GUI) – Andrius Štikonas Dec 07 '16 at 13:30
0

First you need to use on the terminal using gparted:

  1. lvscan This command will scan for active LVM partitions, and hence locked in gparted
  2. Removed ALL locks with: sudo lvremove "partition name"

Now you should be able to resize the LVM partition with Gparted Live.

This will get you closer to incrementing the boot partition, which is also what I'm trying to do...

0

I have an alternative suggestion. If you are running out of space in your boot partition, you can remove your older kernels. How do I remove old kernel versions to clean up the boot menu?

The 243MB space you have should be enough to hold your current kernel and one previous version for peace of mind.

  • I wonder why people still create these small /boot partitions. I myself just have /boot inside my rootfs (which is actually btrfs inside encrypted LVM). Grub can boot from it just fine... And then I never need to worry about size of /boot partition. – Andrius Štikonas Dec 07 '16 at 13:36
  • 1
    In my case the server is a couple of years old and well, I guess most normal users would not know why or if they need a boot partition and definitely not be able to determine an appropriate size :) – Chau Dec 07 '16 at 13:46
  • Legacy setups or ones that have been continually upgraded without a fresh OS and file system rebuild and reconfigure. I started in the late '00s with Ubuntu, and I have carried my partitioning and data along even though I have changed HDs, CPUS, Motherboards, graphic cards, etc – jwernerny Apr 05 '20 at 16:18