How can I increase the /boot partition?

Kernels & Hardware, configuring network, installing services

How can I increase the /boot partition?

Postby Scorpion » 2020-10-25 16:22

Code: Select all
fdisk -l
Device       Start        End    Sectors  Size Type
/dev/sdb1     2048    1050623    1048576  512M EFI System
/dev/sdb2  1050624    1550335     499712  244M Linux filesystem
/dev/sdb3  1550336 7814035455 7812485120  3.7T Linux filesystem

To increase /dev/sdb2, mount point /boot, I need to reduce sdb3.
There is debian system there, with encrypted lvm and no empty space left.

Can I do it when I am using it?

Do I need to create a bootable media with gparted iso?
Can I use another OS and chroot? Now I do not have one.
User avatar
Scorpion
 
Posts: 253
Joined: 2018-10-17 11:38

Re: How can I increase the /boot partition?

Postby p.H » 2020-10-25 16:55

Scorpion wrote:To increase /dev/sdb2, mount point /boot, I need to reduce sdb3.

Or reduce sdb1, the EFI partition. I bet it is almost empty. How much extra space do you need in /boot ?
Didn't you already ask about this ?

Otherwise, you do not only need to reduce sdb3, most importantly you also need to move it. Moving a big partition takes a lot of time and requires that the partition is not in use. If reducing the EFI partition is not an option, I would reduce sdb3 without moving it and create a new /boot partition at the end of the drive. It may be done while the system is running.

In any case if you choose to reduce sdb3 (moving it or not), you must first reduce its contents, i.e. the LVM PV, which may require to reduce some LV (after reducing its contents) and move used blocks away from the end of the PV.
In summary :
reduce LV filesystem (may require to unmount it, depending on filesystem type)
reduce LV
move blocks from the end of the PV
reduce the PV
reduce the encrypted volume
reduce the partition

Of course you should prepare a rescue system.
p.H
 
Posts: 1521
Joined: 2017-09-17 07:12

Re: How can I increase the /boot partition?

Postby Scorpion » 2020-10-26 16:10

Before using apt autoremove I ran out of sapce on /boot, I do not know how much extra space was needed, now:
Code: Select all
df -h
/dev/sdb2                               237M  142M   84M  63% /boot
/dev/sdb1                               511M  5.2M  506M   1% /boot/efi

Yes I can reduce the EFI partition instead of moving 3.7T, or create /boot at the end of the disk.
I did that:
Code: Select all
df -h
/dev/sdb2                               431M  142M  267M  35% /boot
/dev/sdb1                               312M  5.2M  307M   2% /boot/efi
User avatar
Scorpion
 
Posts: 253
Joined: 2018-10-17 11:38


Return to System configuration

Who is online

Users browsing this forum: No registered users and 20 guests

fashionable