4 nov. 2007

Hibernate with Ubuntu Feisty

Hibernate never worked for me using Ubuntu. Now, I'm using Dell Inspiron 8600 and upgraded recently to Ubuntu Feisty. What I did for hibernate to work:

  1. Make sure swap device works correctly. Now there isn't /dev/hd[x] anymore. This has been renamed to /dev/sd[x]. I recreated my swap partition:

    $ sudo swapoff -a # disable swap devices
    $ sudo mkswap /dev/sda3 # recreate my swap partition

    # edit /etc/fstab, make sure to use /dev/sd... My line is:
    /dev/sda3 none swap sw 0 0

    $ sudo swapon -a # enable swap again
    $ sudo swapon -s # see swap devices used
    Filename Type Size Used Priority
    /dev/sda3 partition 1044216 0 -1

  2. Install uswsusp. Kernel driver included in standard Linux 2.6.
    $ sudo apt-get install uswsusp

    You should see a configuration screen, but if it was already installed or no configuration appears, do a:
    $ sudo dpkg-reconfigure uswsusp

    1. The device node through which uswsusp can talk to the kernel: leave blank
    2. Perform checksum on image? No
    3. Compress Image? Yes
    4. Perform early write out? Yes
    5. Preferred maximum image size: proposed value (mine is 600 MB, depends on your RAM)
    6. Log level: Leave blank
    7. Maximal log level: Leave blank
    8. Encrypt image? No

    The config file /etc/uswsusp.conf is written and the initrd images are updated.
    Check this configuration file a see if resume device is accurate. If not, change it and do a:
    $ sudo update-initramfs -u -k all

    Now, s2disk should work correctly. This is the suspend 2 disk command. Try it! But, "hibernate" command and gnome "Log out" screen hibernate option may not work.

  3. Configure hibernate to use uswsusp. Edit the /etc/hibernate/hibernate.conf. Just comment out all lines except:
    TryMethod disk.conf

    Now hibernate may work. (You need sudo.) But gnome desktop utilities may not. Gnome signals through hal that it should hibernate the computer, but the default file /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux uses pmi (power management interface). As some links tell, you can replace it with a version that tries to use s2disk before any other option. Google for: "feisty hibernate hal" and you'll find alternate scripts.

    Now the gnome-power-manager and logoff screen "hibernate" option should work.

  4. If the power button does not work, do:
    $ sudo apt-get install --reinstall acpi-support

For me, at this point hibernate support is perfect.

No hay comentarios:

Publicar un comentario