- wanted to shrink Kubuntu to make space for NixOS
- Maybe the drive was mounted
- but still alot of the same issues were observed when searching online regarding kde partition manager
- ultimate search term
- kde partition manager shrink size in superblock and physical size differ
- filesystems - “Either the superblock or the partition table is likely to be corrupt!” after partition resized - Unix & Linux Stack Exchange
- According to this answer ran e2fsck, a destructive operation just because I was afraid of the command line and didn’t want to use parted
- long process
- resize2fs would’ve deleted rest of the partitions
- slept
- seeked a better solution
- filesystems - “Either the superblock or the partition table is likely to be corrupt!” after partition resized - Unix & Linux Stack Exchange
- found this using growpart to fill the unallocated space, atleast won’t have to delete nixos and windows reserved partitions
- partition - How to recover filesystem and physical size mismatch - Unix & Linux Stack Exchange
- then came across this solution to use parted
- basically partition table via parted got updated but resize2fs failed to resize the filesystem
- simple solution is to update the partition table to the original standard
- used
sudo fdisk -l
to read start and end sectors
- entered
parted /dev/nvme0n1
- resizepart 4 859174911s
- gave sector number for perfect granuality
- Parted - ArchWiki
- had to e2fsck again
- this reversed all the destructive changes that I made the day before
- Kubuntu still wouldn’t boot
- for some reason the files in /boot vanished
- backup was there on desktop
- copied those files from Desktop to /boot started working again
- even though the boot partition is mounted on /boot/efi, kubuntu had installed the files in /boot which is p4 and /boot/efi is on p1
- To boot into kubuntu using the backup files, used this guide: Classic SysAdmin: How to Rescue a Non-booting GRUB 2 on Linux - Linux Foundation
- couldn’t run
sudo update-grub
- did
sudo mkidr <whatever had to be made>
- ran after that
- on success, it will show that the vmlinuz and initrd images were found
sudo grub install /dev/nvme0n1
- Ran diff -r against backups to make sure there weren’t any destructive changes
- Completed 2024-01-11