1. wanted to shrink Kubuntu to make space for NixOS
  2. Maybe the drive was mounted
  3. but still alot of the same issues were observed when searching online regarding kde partition manager
  4. ultimate search term
    1. kde partition manager shrink size in superblock and physical size differ
  5. filesystems - “Either the superblock or the partition table is likely to be corrupt!” after partition resized - Unix & Linux Stack Exchange
    1. 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
    2. long process
    3. resize2fs would’ve deleted rest of the partitions
    4. slept
    5. seeked a better solution
    6. filesystems - “Either the superblock or the partition table is likely to be corrupt!” after partition resized - Unix & Linux Stack Exchange
      1. found this using growpart to fill the unallocated space, atleast won’t have to delete nixos and windows reserved partitions
    7. partition - How to recover filesystem and physical size mismatch - Unix & Linux Stack Exchange
      1. then came across this solution to use parted
      2. basically partition table via parted got updated but resize2fs failed to resize the filesystem
      3. simple solution is to update the partition table to the original standard
      4. used sudo fdisk -l to read start and end sectors
      5. entered parted /dev/nvme0n1
      6. resizepart 4 859174911s
        1. gave sector number for perfect granuality
        2. Parted - ArchWiki
  6. had to e2fsck again
    1. this reversed all the destructive changes that I made the day before
  7. Kubuntu still wouldn’t boot
  8. for some reason the files in /boot vanished
  9. backup was there on desktop
  10. copied those files from Desktop to /boot started working again
  11. 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
  12. 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
grub> set root=(hd0,1)
grub> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
grub> initrd /boot/initrd.img-3.13.0-29-generic
grub> boot
  1. couldn’t run sudo update-grub
  2. did sudo mkidr <whatever had to be made>
  3. ran after that
  4. on success, it will show that the vmlinuz and initrd images were found
  5. sudo grub install /dev/nvme0n1
  6. Ran diff -r against backups to make sure there weren’t any destructive changes
  7. Completed 2024-01-11