About three weeks ago my employer asked me to shrink the swap partition of a GNU/Linux Ubuntu 8.04 system so as to gain several gigabytes for the root filesystem. After resizing, hibernation failed in a way that although the hibernation process was without any error, turning on the machine again didn't resume the hibernated state. After resizing, the swap space still had enough space for hibernation for sure, and the UUID for the swap space in `/etc/fstab' had been adjusted as well. Just last Friday my employer tried again to solve this problem by googling for information. After a while I got a call, and this time my employer and I found the culprit. Having such an employer is so much fun!
First, my employer tried to install uswsusp following a thread in the Ubuntu forum. After the installation, he tried to run `s2disk' that failed with the following error message:
s2disk: Could not stat the resume device file. Reason: No such file or directory
`s2both' also didn't work with the following error message, which is just the same:
s2both: Could not stat the resume device file. Reason: No such file or directory
So, he called me and had me drill down the problem further. I read the man page of `s2disk' and checked `/etc/uswsusp.conf'. It turned out that the value for key `resume device' was in a wrong UUID. So, I fixed the UUID. But, still the error message about not being able to find the image disk persisted. So, I realized that uswsusp didn't recognize UUID and had to be supplied with `/dev/*'. So, I changed that to `/dev/*'. Now `s2disk' worked. But, when the machine was powered back on, the state was not resumed. So, the hibernation failed. So, my employer suggested to purge uswsusp and install it again. Doing it I saw in the uswsusp installation process the following message:
The swap file or partition that was found in uswsusp's configuration file is not active. In most cases this means userspace software suspend will not work for you and you will need to choose (or let uswsusp choose) another swap space. In some corner cases however, this can be what you want.
Continue without a valid swap space?
Answering `yes' caused the key `resume device' in `/etc/uswsusp.conf' to have a wrong UUID again instead of `/dev/*'. Since the UUID of the swap device listed in `/etc/fstab' was correct, I wondered from where uswsusp got the wrong UUID. After purging and reinstalling uswsusp several times, I realized that update-initramfs was invoked at the end of the installation process provided that I answered `yes' for the question `Continue without a valid swap space?'. So, I went to `/etc/initramfs-tools' and did `ls -r *'. There I saw `resume' under `conf.d'. Seeing its content, I realized that uswsusp had been taking the value for its `resume device' from this file. So, I fixed the content of `resume', purged and installed uswsusp again. This time it was without the error message. Now hibernation worked successfully.
Although I was happy enough with the result, my employer said, "I have a hunch that now the original hibernate should work since it stopped working after the resizing process changed the UUID of the swap space and `/etc/initramfs-tools/conf.d/resume' is not updated to the right UUID." He was right! Now the original hibernate works perfectly and so I purged uswsusp. Heh, I should have got such a hunch myself ;-)
So, I conclude the following points:
1. `/etc/initramfs-tools/conf.d/resume' belongs to the original hibernate function.
2. uswsusp reads `/etc/initramfs-tools/conf.d/resume' to initialize its `resume device' in `/etc/uswsusp.conf'.
3. uswsusp cannot understand UUID format (bug filed: https://bugs.launchpad.net/bugs/404085).
4. gparted changes the UUID of the swap partition although only moving or resizing operation is applied. It should not be like this since resizing a reiserfs filesystem, for example, does not change its UUID. (bug filed: https://bugs.launchpad.net/bugs/404095).
Out of the two bugs, one is solved: gparted bug
Hi Ho!
Out of the following two bugs:
1. uswsusp cannot understand UUID format (bug filed: https://bugs.launchpad.net/bugs/404085).
2. gparted changes the UUID of the swap partition although only moving or resizing operation is applied. It should not be like this since resizing a reiserfs filesystem, for example, does not change its UUID. (bug filed: https://bugs.launchpad.net/bugs/404095).
the second bug is already solved:
http://bugzilla.gnome.org/show_bug.cgi?id=575585
Best regards,
Eus (FSF member #4445)
In this digital era, where computing technology is pervasive,
your freedom depends on the software controlling those computing devices.
Join free software movement today!
It is free as in freedom, not as in free beer!
Join: http://www.fsf.org/jf?referrer=4445
I needed another step
Hi there.
Thanks for your post, it put me on the right track to solve my problem (just the same as yours). However, I would like to point out that if you want to make ubunt's built-in hibernation work again, updating /etc/initramfs-tools/conf.d/resume is not enough.
As explained in this Thread, you need to execute 'sudo update-initramfs -u' after in order to effectively use the new UUID.
In your case, as you explained, this command was automatically executed when purging and installing uswsusp. I just wanted to point it out just in case it might save some time to someone.
Yes, you are right!
Hi Ho!
Yes, you are right!
Thank you for pointing this matter out :-)
--
Best regards,
Eus (FSF member #4445)
In this digital era, where computing technology is pervasive, your
freedom depends on the software controlling those computing devices.
Join free software movement today! It is free as in freedom, not as in
free beer!
Join: http://www.fsf.org/jf?referrer=4445
Beware of UUID in /etc/initramfs-tools/conf.d/resume
I add the following comment verbatim on behalf of my friend at www.infi-nity.com who previously made me start this thread, to help others.
--- 8< -------------------------
Eus,
I finally fixed the hibernation problem...AGAIN. ;)
In short, this time around I was still having problem even after following the steps like we did (plus Pablo's additional step). The curious thing was that I was able to hibernate and resume successfully using s2disk (part of uswsusp package) - where I failed with the normal hibernation that comes with Ubuntu.
So, I checked up on the config file for uswsusp as follow "cat /etc/uswsusp.conf" and here is what I saw:
resume device = /dev/sda6
splash = y
compress = y
early writeout = y
image size = 973360824
RSA key file = /etc/uswsusp.key
After a while I suspected that if I changed my "/etc/initramfs-tools/conf.d/resume" file as follow, things would work:
RESUME=/dev/sd6
Please take note that previously the configuration was done using the UUID notation, as follow (where the UUID noted below is the UUID for /dev/sda6):
RESUME=UUID=7740fbf5-bce8-43ab-9603-7905881f3435
After changing the resume file to point to the swap using label notation, I updated the initramfs using the usual "sudo update-initramfs -u".
Long and behold the normal hibernate and resume worked as before. BTW, I haven't removed my uswsusp package I doubt it would have any effect anyhow).
So that's the twist. Any rationales as to why it behaves as such?
www.infi-nity.com
/etc/initramfs-tools/conf.d/resume hates UUID now?
Perhaps the hibernator that uses /etc/initramfs-tools/conf.d/resume now hates UUID. What are the GNU/Linux distro and version that had the problem?
It's just the same one.
Submitted verbatim on behalf of infi-nity.com since this reply is regarded as a spam:
--- 8< --------------------------------------------
It's the same Jaunty, so I doubt it is a particular distro (version) problem. If the hibernator is part of the Linux kernel, it could be the culprit as I have been updating my kernel.
Try older kernels
Quoting http://www.linux.com/news/hardware/laptops/8253-how-to-suspend-and-hiber...
it is possible that swsusp of newer kernel hates UUID in the resume file.
Could you please try the older kernels? You can select one of the older kernels from the GRUB boot menu.