You are not logged in.

#1 2023-01-20 15:40:11

ollosh
Member
Registered: 2022-09-20
Posts: 44

[SOLVED] How to decrease partition and increase size of /boot

I need to do some grub changes, but I've noticed that my /boot partition is full and is only ~100M big.

Filesystem      Size  Used Avail Use% Mounted on
dev              16G     0   16G   0% /dev
run              16G  3.3M   16G   1% /run
/dev/nvme0n1p5  670G  167G  469G  27% /
tmpfs            16G  353M   15G   3% /dev/shm
tmpfs            16G  261M   15G   2% /tmp
/dev/nvme0n1p1   96M   96M  1.0K 100% /boot
tmpfs           3.1G   44K  3.1G   1% /run/user/1000

I want to decrease the size of my main partition which is /dev/nvme0n1p5 and increase the size of /boot partition to 1G. I'm having hard time figuring out how to do this since I really don't want to loose any data or corrupt my system.
I've tried playing around with cfdisk while booting from boot media, but I only ended up screwing my partition tables and couldn't boot again into my system before reverting the sizes. Also cfdisk didn't allow me to increase the size of /boot partition.

Which steps would I need to take to do this as painless as possible?

Last edited by ollosh (2023-01-22 20:04:26)

Offline

#2 2023-01-20 15:46:17

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] How to decrease partition and increase size of /boot

Use a gparted Live USB.

But you still need to make sure that you have backups as all operations involving moving and resizing partitions carry some risk.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2023-01-20 17:29:45

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] How to decrease partition and increase size of /boot

Or shrink the root partition slightly (without "moving" it) and add an XBOOTLDR partition for /boot instead of the ESP.

https://wiki.archlinux.org/title/System … g_XBOOTLDR

Offline

#4 2023-01-20 18:09:57

Maniaxx
Member
Registered: 2014-05-14
Posts: 738

Re: [SOLVED] How to decrease partition and increase size of /boot

Alternatively, if your main partition is not encrypted you could also move most files (kernel, initramfs, grub data) to main partition instead so only the mandatory efi bootloaders reside on /boot partition. 100MB should be plenty for this setup. Grub needs ~200KB for its bootloader. Windows 10 needs ~200MB.

Last edited by Maniaxx (2023-01-20 18:24:24)


sys2064

Offline

#5 2023-01-22 16:04:40

ollosh
Member
Registered: 2022-09-20
Posts: 44

Re: [SOLVED] How to decrease partition and increase size of /boot

Hmm this is becoming a bit of a nightmare now since I can't really increase the size of the efi partition. I thought that whicever partition you shrink you'll have free space to allocate on another partition, but I guess I'm missing a lot of knowledge about partitions. Basically what I have is a dual boot with Windows and I guess when I was creating an efi partition when installing Windows I've selected only 100M. Now even shrinking my other windows partitions does not help. I do have this weird windows partition between efi and actual windows data that seems reserved and I'm unable to move it, shrink it or do anything with it hmm

Offline

#6 2023-01-22 20:12:05

ollosh
Member
Registered: 2022-09-20
Posts: 44

Re: [SOLVED] How to decrease partition and increase size of /boot

Ok I've finally managed to solve this one. So important thing that I did not understand immediately is that unallocated space and partition need to be next to each other. So basically I had partitions p1 (boot), p2, p3, p4, p5. I initially wanted to resize p5 and increase p1, but that does not work. What I needed to do is decrease p3 (windows partition) and unallocate space on the beginning of it. Then I needed to 'move' p2 to use that space and free space on the beginning of it. Only then I was able to increase the size of p1.

I did still come across some issues with gparted like problems with increasing size of fat32 format (p1 boot partition) and I first needed to format it to different format, increase it and then format it back. I did backup of /boot somewhere and was able to restore it after format, but I still needed to reconfigure grub from beginning. Now things are finally working!

Hopefully this post helps someone

Offline

Board footer

Powered by FluxBB