Deleted Swap, now boot takes forever

If you want to remove the swap partition, you should first try by commenting its entry in /etc/fstab, then reboot.

As for the long boot time, it may be that one of your filesystems has been damaged. As soon as your system is up, run the appropriate fsck.* command for each of the file systems. If it reports errors, it will usually recommend how to fix them.

(Btw, running a system without swap is perfectly normal. I'm doing this since several years – these days, common machines have enough RAM.)


From Terminal run

    sudo blkid

Then

    cat /etc/fstab

Double check that the fstab entry for swap partition matches all entries in the blkid

Your fstab entry should look something like this=>

    UUID=your/UUID/here none      swap    sw        0       0

If they don't match with each other, change UUID in fstab using your preferred text editor, to match the one you get from command sudo blkid. Then reboot and you'll see the effect.


You may also need to edit the /etc/initramfs-tools/conf.d/resume file and comment out any references to the deleted Swap partition

sudo nano /etc/initramfs-tools/conf.d/resume
#RESUME=UUID=2854a8db-6494-44ac-9cee-974714bb0b00

I commented out the swap entries in /etc/fstab and the slow boot wasn't resolved. I also made sure that my swap wasn't encrypted, since no /etc/crypttab existed as suggested by @ankit7540. In the end, i came across this error message while installing a virtualization package and this gave me the right direction

W: initramfs-tools configuration sets RESUME=UUID=2854a8db-6494-44ac-9cee-974714bb0b00
W: but no matching swap device is available.

From the docs:

The initramfs is an cpio archive. At boot time, the kernel unpacks that archive into ram, mounts and uses it as initial root file system. From there on the mounting of the real root file system occurs in user space.

resume
      The resume hook tries to autodetect the resume partition and uses  the  first  swap
      partition   as  valid  guess.  It  is  possible  to  set  the  RESUME  variable  in
      /etc/initramfs-tools/conf.d/resume.  The boot variable noresume overrides it.

In simpler words, since a swap partition is a requirement for hibernation in Ubuntu, it makes sense that it'll be defined in some boot config as the RESUME parition and the boot process will look for it.