[SOLVED] Hibernation Problem: No swap header found
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just installed ubuntu and I didn't create a swap partition while installing it so I created a swap partition after installation using Gparted because I couldn't hibernate as error appeared:
Code:
couldn't find swap device try swapon -a
Now that I created a swap partition and using
Code:
sudo gedit /etc/fstab
output:
Code:
total used free shared buff/cache available
Mem: 7887 1524 5145 83 1217 6030
Swap: 12461 0 12461
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
You say you have created a "SWAP partition", but yet you specify a "SWAP file" in fstab, that's your problem. fstab mounts are usually done via UUID rather than the device node. The problem is that if the same drive gets a different node, then fstab would be incorrect.
Below is a snippet of my fstab for my SWAP partition;
You say you have created a "SWAP partition", but yet you specify a "SWAP file" in fstab, that's your problem. fstab mounts are usually done via UUID rather than the device node. The problem is that if the same drive gets a different node, then fstab would be incorrect.
Below is a snippet of my fstab for my SWAP partition;
Simply just copy my example in post #2 and replace the UUID for my SWAP partition to yours. I would only have one entry in fstab for your SWAP partition though.
Simply just copy my example in post #2 and replace the UUID for my SWAP partition to yours. I would only have one entry in fstab for your SWAP partition though.
I am able to hibernate now. But the difference I noticed this time is that it takes quite a long time to wake up from hibernation( almost like doing power on) while before it used to take less time. Also now I find system crash error which I tried fixing by
sudo rm /var/crash/*
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by ersa21
I am able to hibernate now. But the difference I noticed this time is that it takes quite a long time to wake up from hibernation( almost like doing power on) while before it used to take less time. Also now I find system crash error which I tried fixing by
sudo rm /var/crash/*
Could you tell me what might have caused this?
If you mean your original problem:
Quote:
Originally Posted by ersa21
I just installed ubuntu and I didn't create a swap partition while installing it so I created a swap partition after installation using Gparted because I couldn't hibernate as error appeared:
[error messages snipped]
...
If you mean this "system crash error" you mention above, hard to say without some more details to go on. I very much doubt removing the contents of the /var/crash/ folder is going to "fix" anything.
Have a look in your /var/log/messages file for any error messages, but you maybe should start a new thread if this is different problem.
Quote:
Thanks a lot.
If you really want to thank me, perhaps mark what post(s) of mine you have found helpful.
You set up your swap partition but you never told the grub bootloader where to find it. I believe you have to do both. See the discussion here which references arch linux:
Also, as alluded to in the above link, some distros will hardcode the hibernation location into the initrd. I know debian does; not sure about the *buntus. If that's the case for your distro, you will have to make a new initrd with this info included. Here's a discussion on how to do that in debian:
The specifics vary from distro to distro so you should consult your distro's documentation. The point is that you probably have to do more than just create a swap partition after the initial installation in order for hibernation to work properly. All this stuff will be set up automatically during installation in most distros if an adequately sized swap partition is created at that time. If you create the swap partition afterwards, you will have to do some more work to get hibernation working properly in all likelihood.
Last edited by kilgoretrout; 11-13-2018 at 05:31 PM.
You set up your swap partition but you never told the grub bootloader where to find it. I believe you have to do both. See the discussion here which references arch linux:
Also, as alluded to in the above link, some distros will hardcode the hibernation location into the initrd. I know debian does; not sure about the *buntus. If that's the case for your distro, you will have to make a new initrd with this info included. Here's a discussion on how to do that in debian:
The specifics vary from distro to distro so you should consult your distro's documentation. The point is that you probably have to do more than just create a swap partition after the initial installation in order for hibernation to work properly. All this stuff will be set up automatically during installation in most distros if an adequately sized swap partition is created at that time. If you create the swap partition afterwards, you will have to do some more work to get hibernation working properly in all likelihood.
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.
Here is my new post for that problem, https://www.linuxquestions.org/quest...ed-4175642263/
Also another error i.e. System Problem detected in Ubuntu.
Could replacing swap file with partition be leading to these problems?
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by ersa21
...
Also another error i.e. System Problem detected in Ubuntu.
You should talk about this in your other thread, and maybe rename your other thread as well. If you're sure it's a separate problem.
Quote:
Could replacing swap file with partition be leading to these problems?
I really doubt it.
But I think we need to be sure you can actually hibernate it to begin with. When you hibernate it and bring it back out of hibernation, does your machine after firmware starts looking for the operating system go straight to the graphical environment, which then asks you for a password of the user account you were logged in under when you hibernated it, or does it just start up normally and go to the login screen as usual?
Last edited by jsbjsb001; 11-14-2018 at 06:12 AM.
Reason: re-worded and mis-posted
You should talk about this in your other thread, and maybe rename your other thread as well. If you're sure it's a separate problem.
I really doubt it.
But I think we need to be sure you can actually hibernate it to begin with. When you hibernate it and bring it back out of hibernation, does your machine after firmware starts looking for the operating system go straight to the graphical environment, which then asks you for a password of the user account you were logged in under when you hibernated it, or does it just start up normally and go to the login screen as usual?
When I resume from hibernation,it starts from beginning as if being powered off.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.