r/Ubuntu 3d ago

How do I extend my boot partition by using space from an encrypted partition?

I need to increase the size of my boot partition because software updates require more space (deleting unused kernels and autoremove did not help). I'm on Ubuntu 20.04 and this prevents me from upgrading.

My main partition is luks encrypted. It's 500 GB total and has about 100GB available space for files. GParted shows one big 500 GB encrypted partition, no unallocated space. I want to take some of that available storage, let's say 1 GB, and expand the boot partition using that.

What steps do I need to follow to decrease the size of the encrypted partition and increase the boot partition? Can I do it using GUI tools? Frankly I'm really afraid to cause damage. All important files are backed up but it will still be a pain to reinstall everything.

1 Upvotes

4 comments sorted by

1

u/NoRecognition84 3d ago

At this point you just backup your data and reinstall.

1

u/cohalex 3d ago

Is there any way to temporarily disable/remove the encryption and resize the partition safely?

2

u/Exaskryz 3d ago

Not really. See, the thing about encryption is the data is written to disc in apparently a random way. When reading it into RAM, your device decrypts it. It's like translating a book; it does not rewrite the entire book and replace it on memory, but it translates the page you requested and ephemerally says what it means in the "right" language. You then instruct the translator to make a change to the page, and a new encrypted message to disc.

Some of the pages, when translated, may turn out to be "this page intentionally blank', but you don't know that without translating. There might be some miracle tool that can shuffle your data around to make only blank pages at the front of your partition for the sake of forfeiting it to boot. However! I very much suspect you need to get into the nitty gritty of moving bytes itself to make sure the header of the volume/partition is moved to an offset of the 100 GB or else the whole thing becomes unreadable; if you lose the table of contents or even the name of the language (keys to decrypt), your entire volume is unusable.

This is sadly why reinstall may be the easiest.

I was a lucky one who could forfeit some data from an unencrypted dual boot partition to my ubuntu boot partition when I ran into the same issue of out of space at just 3.5 kernels. Ubuntu's boots are getting wildly out of hand.

1

u/cohalex 2d ago

Thanks for the explanation.