May 13

After upgrading to Hardy, hibernate stopped working. Usplash would show the animated splash screen for a few seconds on boot, then it would go away an I would see a text boot screen starting with the “Reading files needed to boot” text. The system would go into hibernate normally, but would never boot back to where I was, it was like I’d never hibernated. After a bit of digging, I found the problem. The UUID for my swap file system was not the same as the value entered for the resume file system in initramfs. Here is the steps required to fix this problem:

1. Make sure you have the initramfs-tools update

sudo apt-get install initramfs-tools

2. Run the blkid util to show what your existing UUIDs are.

root@hardy-desktop:~# sudo blkid
/dev/sda1: UUID="a76fe101-7951-4a65-af1e-50b2902c5b35" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="8dd072f1-25b3-4a7f-888f-2314697d60b9"

3. Verify that the UUID listed for the swap partition in the previous step matches what is listed in /etc/fstab

root@grigsby-desktop:~# cat /etc/fstab
proc /proc proc defaults 0 0
# /dev/sda1
UUID=a76fe101-7951-4a65-af1e-50b2902c5b35 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=8dd072f1-25b3-4a7f-888f-2314697d60b9 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

4. Modify the UUID in /etc/initramfs-tools/conf.d/resume file to match the UUID listed for the swap partition from blkid.

root@hardy-desktop:~# cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=617b4b90-112e-497a-bc6b-dda2a3e7565e
root@hardy-desktop:~# sudo vi /etc/initramfs-tools/conf.d/resume

5. Update the initramfs.

sudo update-initramfs -u

6. Restart the system.

19 Responses

  1. Steve Says:

    WOOOHOOO! Thanks. Mine crashed after moving the swap partition.

  2. Josh BW Says:

    WHEW!!! Thanks. I’ve been searching for days to find a fix. After moving my swap partition this problem began. At first I thought if was an issue with external USB devices… at least thats the direction most of the forum threads pointed. I was about to give up and reinstall the OS.
    Now that wont be necessary. Your fix worked perfectly!!

    Thanks for posting it ;-)

  3. Ewout Says:

    Thanks for the great fix. After installing 8.04 together with a few other O/S’s, the bootproblems began. Ubuntu forums were no help at all.
    Your fix was right on target and afterwards no problems at all with booting.

    Thanks for this post

  4. siegie Says:

    Thanks for the fix.

  5. hugo Says:

    Yeah, thx a lot! Great stuff. I also have had the problem that my swap partion has no uuid. To get one do this:

    sudo swapoff -v /dev/sdaX
    sudo mkswap -U $(uuidgen) /dev/sdaX
    sudo swapon -v /dev/sdaX

  6. Alexander Says:

    Thanks. Problem was active after i move Hardy on another disk. Now it’s solved. :-)

  7. Seemanta Says:

    Yippee!! Thanks a lot! No, sorry it ought to be an infinite number thanks!

    You have solved my problem of Hibernation not working since I did some repartitioning of my HDD. Tried hard to find the fix, but did not until stumbled here!

    Now with this fix, it works PERFECTLY!!
    May you live long and prosper! \\//

  8. cover Says:

    Thx!
    But I have a problem,
    I no swap partion,how to ?
    Thx!!!
    :)

  9. Garl Says:

    @cover – You have no swap partition at all? Then you shouldn’t be able to hibernate at all. Can you post your fstab file?

  10. chaoge Says:

    Hi, I am a Chinese user, I have encountered this problem, but have not been solved. Here are some of my cases to you for help!
    My e-mail: chaogege.cn @ qq.com hope you can give me some comments! Thank you very much!

    run?sudo blkid
    return list?
    /dev/sda1: UUID=\D4B6692AB6690E74\ LABEL=\?????\ TYPE=\ntfs\
    /dev/sda5: UUID=\FE905CF0905CB140\ LABEL=\?????\ TYPE=\ntfs\
    /dev/sda6: UUID=\C8F03274F03268B8\ LABEL=\?????\ TYPE=\ntfs\
    /dev/sda7: UUID=\C0F0E404F0E3FE93\ LABEL=\?????\ TYPE=\ntfs\
    /dev/sda8: UUID=\54740ea0-aca6-4630-9aef-98e916a4dc5e\ TYPE=\ext3\
    /dev/sda9: TYPE=\swap\ UUID=\e82f7677-ebdc-4237-bf56-40c23d1c1f79\

    run?cat /etc/fstab
    return list?
    # /etc/fstab: static file system information.
    #
    #
    proc /proc proc defaults 0 0
    # /dev/sda8
    UUID=54740ea0-aca6-4630-9aef-98e916a4dc5e / ext3 relatime,errors=remount-ro 0 1
    # /dev/sda9
    UUID=e82f7677-ebdc-4237-bf56-40c23d1c1f79 none swap sw 0 0
    /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

    run?cat /etc/initramfs-tools/conf.d/resume
    return?
    RESUME=UUID=e82f7677-ebdc-4237-bf56-40c23d1c1f79

    open Grub list:menu.lst?you can see?
    splashimage=54740ea0-aca6-4630-9aef-98e916a4dc5e/boot/grub/splash.xpm.gz

    title Personal Ubuntu 8.10 Desktop Edition
    uuid 54740ea0-aca6-4630-9aef-98e916a4dc5e
    kernel /boot/vmlinuz-2.6.27-12-generic root=UUID=54740ea0-aca6-4630-9aef-98e916a4dc5e ro quiet splash
    initrd /boot/initrd.img-2.6.27-12-generic
    quiet

  11. Raghu Says:

    Hi, I tried to follow but my ubuntu does not boot at all. And am not able to write Sudo command on command line which is getting me error. How do I solve.?

  12. lelamal Says:

    Cheers, mate. I had no swap partition either (had deleted it in error), and after creating one, your procedure worked like a charm on Ubuntu 8.10. I had to manually edit the resume file, though, for I couldn’t do it in terminal. Anyway, many thanks!

  13. Jeremy Says:

    Thanks for the enlightenment! For people who use multiple kernels like me: sudo update-initramfs -u -k all

  14. Savio Rodrigues Says:

    Thank you. I would install everything again. The error occurred when I increased the size of the swap partition. Greetings from Brazil.

  15. roberto Says:

    thanks dude

    from chile

  16. fox Says:

    Works great, if you don’t want to hibernate and have no Swap Partition, just replace the UUID line
    /etc/initramfs-tools/conf.d/resume
    with a blank line.

  17. Wesley Says:

    I followed the instructions “to a tee,” but they failed to resolve this issue. Is there anyone who can assist me in figuring out why?

  18. Buy Cymbalta Says:

    Thanks a lot..

  19. Buy Cymbalta Says:

    I have no idea about this.. This third party like sudo codings through we knows about that booting process..

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

*