what do I need to know before I shrink a LUKS partition to enlarge the boot partition?
from arsus5478@lemmy.ml to linux@lemmy.ml on 16 Aug 19:49
https://lemmy.ml/post/34781409

lsblk:

I need to enlarge nvme0n1p2 by shrinking nvme0n1p3 (LUKS)

do I have to do something with /boot/efi? enlarge as well?

backing up as of now

#linux

threaded - newest

just_another_person@lemmy.world on 16 Aug 19:58 next collapse

You have zero free space there. Who is telling you to resize anything?

arsus5478@lemmy.ml on 16 Aug 19:59 collapse

please eli5

just_another_person@lemmy.world on 16 Aug 20:01 collapse

Your entire disk is already allocated. You can’t easily shrink anything and move space around.

You also shouldn’t need to expand your boot partition at all.

Who or what is telling you this is needed?

BCsven@lemmy.ca on 16 Aug 20:09 next collapse

You can resize partitions if disk is all full…depending on fs of course…but shrink, move, grow works.

arsus5478@lemmy.ml on 16 Aug 20:18 collapse

still don’t follow: should I shrink instead of resize?

BCsven@lemmy.ca on 16 Aug 20:46 collapse

I typically use gparted live, or GNOME disk utily, so I don’t know the command names, I slide the sliders and hit OK 😀

arsus5478@lemmy.ml on 16 Aug 20:17 collapse

debian 13 needs more boot space, my boot partition is too small to complete the upgrade

isgleas@lemmy.ml on 17 Aug 07:05 collapse

Have you tried to do some cleaning on your /boot filesystem? It could be you have some old stuff there that may well be wasting storage

monovergent@lemmy.ml on 16 Aug 21:33 next collapse

I got away with a 380 MB /boot during upgrade, though that assumes you aren’t dual booting another distro that also needs some room. Have you tried deleting old kernel versions?

But if you want to future-proof, the issue is that shrinking a partition from its “top” is not a supported function. For ease of explanation, suppose we want a 1.5 GB /boot partition:

  1. Shrink nvme0n1p3 by 1.5 GB
  2. Create a new partition and format
  3. dd the old boot partition to the new partition
  4. Resize the new /boot partition to the full 1.5 GB
  5. Delete the old boot partition
  6. For good measure, reinstall GRUB to make sure it is aware of the new partition: wiki.debian.org/GrubEFIReinstall

This assumes your fstab file mounts by UUID (default in recent versions of Debian). If not, update /etc/fstab to match the new partition. It’s been a while since I last did this, so definitely have your backup on hand and perhaps double check with other resources in case I left out any steps.

More precisely, shrinking relies on the presence of empty blocks. A filesystem usually fills from “top” to “bottom”, so there would be no empty blocks to shave off the top of your nvme0n1p3, you can only shave off at the end. If you really don’t want /boot at the end, you’ll have to shrink nvme0n1p3, back it up, delete nvme0n1p3, expand /boot, re-create nvme0n1p3, and dd the backup back into its place.

digdilem@lemmy.ml on 16 Aug 21:37 next collapse

Back up everything before you start playing with partitions.

No, seriously, do it.

pewpew@feddit.it on 17 Aug 00:07 next collapse

That’s how I accidentally corrupted my Windows partition that I was trying to shrink to make space to Linux… Oh well…

uairhahs@lemmy.world on 17 Aug 08:15 collapse

I also recommend keeping a Live boot USB at hand in case something goes wrong.

deadcade@lemmy.deadca.de on 16 Aug 23:37 next collapse

Looking at this, I’d personally delete both EFI and boot partitions, then remake them with the EFI partition significantly smaller (it should not exceed >100MB used). I have no idea what issues this would cause on Debian, and what specific configuration needs to be changed/updated. I’d guess you need to change the fstab entries, remake the initrds, and reinstall/reconfigure the bootloader.

Any manual messing with partitions, especially rootfs/boot/efi, can easily lead to a broken system. The fix will not be a simple procedure.

As you’re considering messing with your rootfs, I’m going to assume you have a backup. It’ll be significantly easier for you to wipe everything, install fresh new Debian, and copy your personal files over to the new installation.

uairhahs@lemmy.world on 17 Aug 08:23 collapse

Misleading, I have a dual boot set-up with multiple UKIs that require ~300MiB each and therefore have a 4GB EFI part, there is no strict required size for a EFI partition and no it does not affect boot times. OP, If I were you, I would familiarise myself with chroot. When you resize your Linux partition to accommodate a larger boot partition (the first partition) often times partition UUIDs (unique universal identifier) have a quirk of wanting to change that then requires you to update your /etc/fstab to tell Linux where to look for all your partitions, without being able to directly boot your OS. Is it possible to grow your EFI and resize your Linux Part? Yes. Is is an easy risk free process? Absolutely not. If you prefer doing a clean instal with less manual work I would follow the resize and reinstall all approach described above.

glitching@lemmy.ml on 17 Aug 08:36 collapse

combine efi and boot into a single partition and switch to systemd-boot