I recently removed windows 10 from my pc, how can i merge the unallocated space with /dev/nvme0n1p5? There’s the boot partition between so i can’t just adjust one of them and merge with the other using the resize/move button. How can i do it?

  • You shouldn’t need to reinstall Grub if the ESP partition is anything to go by; that indicates the presence of a UEFI system.

    I don’t know what you mean by resize/moving “new partition 1”.

    This is how I would approach your situation:

    1. Starting position (smaller, because VM)

    Make special note of the UUID of the root partition (3d55....). Also write down the UUID of the boot partition (not depicted here).

    1. Move the /boot/efi partition to the left

    1. Grow and move root

    1. Apply changes

    2. Check UUIDs

    If any of the UUIDs changed, mount the root partition and edit /etc/fstab to update the new mount location. Then run whatever your distro uses to update the bootloader (update-grub, or an invocation of grub-mkconfig), initramfs (mkinitramfs, mkinitcpio, dracut, or something else) to make the configuration stick.

    1. Reboot

    Here’s a short video of the resize process:

    Resizing will take longer on your machine, of course.

    Alternatively, you could use this opportunity to add encryption to your system. To do that, I would move the boot partition, create a new, encrypted root partition, mount both root partitions and copy over all the files (rsync -av /mnt/old-root /mnt/new-root), update the partition details as above but also configure /etc/crypttab and add the necessary crypto boot modules (if they weren’t present on your system already). Then delete the old partition, extend the crypto container, extend the root partition, and you have yourself an encrypted-at-rest system. This process would add a whole bunch of potential breaking points so don’t do it if you don’t want to take the risk, but it would make your system more secure in the process.