Quote:
Could replacing swap file with partition be leading to these problems?
|
Hibernation to a swap file was not supported by default last time I looked at ubuntu. Apparently, you can get it to work with a swap file but the procedure is somewhat complex. See for example here:
https://askubuntu.com/questions/1034...fter-hibernate
If you don't want to go through all that, you need to have a swap partition which was not present at installation so none of the underlying plumbing to support hibernation was configured. You'll have to do that by hand now to get it to work properly.
Quote:
I replaced my swap file with swap partition in fstab after which I am able to hibernate but that led to another problem i.e. applications are closed when resuming from hibernation.
|
Then you're not hibernating the system; you're just rebooting.
The fix depends on which version of of ubuntu you have. 18.04 is different than prior versions of ubuntu from what I can see googling around a bit. See for example:
https://ubuntu-mate.community/t/hibe...te-18-04/16924
That person is using ubuntu 18.04 mate but the procedure should be the same for standard ubuntu 18.04. You'll just have to change the text editor from pluma to gedit which is the standard text editor for gnome. Take a look at the above link and see if you can understand what's going on and give it a try. Post back with questions if you're not sure. This person is just editing the grub configuration files to properly identify where the hibernation data has been stored on the hard drive, i.e. the swap partition.
However, that may not be the end of things. See the discussion here:
https://askubuntu.com/questions/1033...p-part#1033139
There they talk about editing a host of configuration files trying to get hibernation to work properly, including generating a new initrd, edits to systemd files and edits to grub configuration. That's pretty heady stuff for a beginner. It all may be a little over your head if your not familiar with linux. If you don't have a lot invested in this installation, you may just want to reinstall but this time create a swap partition at least as large as your ram. That way all this underlying plumbing to support hibernation will hopefully be done for you during installation.