I have recently just purchased a new Acer laptop.
I opened up Windows and opened up the partition manager on Windows, then I shrank my current partition that Windows is on to create an additional, unallocated partition to install Ubuntu 22.04 on.
I ran a live USB of Ubuntu 22.04 and installed Ubuntu automatically.
I did not manually create or mount any partitions like swap, etc... I just followed the automatic install prompt.
Ubuntu was installed correctly on that partition.
I restarted Ubuntu and it ran fine as expected.
However, I cannot get the laptop to go into hibernation when the lid is closed. I have tried various tutorials online, but none seem to work. I need hibernation to work correctly because when I close the lid now the battery drains and laptop dies!
I am not sure if it's not working because I didn't set a swap partition when initially installing, or what could be wrong!
Any help would be greatly appreciated! Please! Thank you!
Update:
My fstab file is displayed below.
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p5 during installation
UUID=bec289b6-5b1e-4e67-b733-01c9e37a8ccd / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=D083-8094 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
I have removed the duplicate entry. So, it appears that I do have swap file.
Update:
I have figured out the problem! I followed the instructions here: https://ubuntuhandbook.org/index.php/2021/08/enable-hibernate-ubuntu-21-10/
and my laptop is now hibernating correctly! Thanks for the help ya'll!