Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
Like this article? We recommend Reconfiguring Boot

Reconfiguring Boot

Next, you need to configure /boot/grub/menu.lst to add the resume device partition:

$ sudo nano /boot/grub/menu.lst

Don't use the [path-to] information you used earlier; instead, uswsusp uses the filename and resume-offset information in the /etc/uswsusp.conf file to determine where the swap file begins.

Delete quiet splash from the default command option, or the splash screen will conceal the password prompt displayed when you resume from hibernation, making resuming impossible. The recommended "usplashy" userspace splash screen breaks kubuntu-desktop. The following is correct:

# defoptions= resume /dev/sda2

Save and exit.

$ sudo update-grub

Open menu.lst and make sure that the default boot shows the option you added above at the end of the boot stanza.

title                Ubuntu 9.04, kernel 2.6.28-11-generic
uuid                 a7165d82-7e8e-4c08-9d50-6910d673cb51
kernel               /boot/vmlinuz-2.6.28-11-generic
                     root=UUID=a7165d82-7e8e-4c08-9d50-6910d673cb51 ro resume=/dev/sda2
initrd               /boot/initrd.img-2.6.28-11-generic
quiet

Once the settings are right, close the file. (You can edit or delete unwanted options with a text editor.) Make sure that you have only the correct options in defoptions, and then rerun update-grub.

The "recovery" boot option doesn't have the resume option. This is deliberate. If there's a problem with the hibernate setup, you want it to boot normally so that you can check the logs (/var/log/pm-suspend.log ) and use the following command to see what happened:

$ dmesg

When menu.lst is correct, reboot the computer.

At this point, you should have the swap working. You can test hibernate by selecting it from the K menu shutdown. You should see a black screen with flashing cursor, followed by seeing the s2disk saving a snapshot, with percentage saved incrementing until the system shuts down. Reboot again, and you'll see a console, with the information usually concealed by the Kubuntu splash screen displaying, until it stops for a password prompt. Enter the password, and the system will finish booting to the desktop as you left it. This process will take as long as booting plus KDE startup does, so wait a few minutes before deciding that you've got a problem. You might see some odd image artifacts onscreen during boot; they should disappear as soon as booting is complete.

Test the suspend capability by closing the netbook's lid. If this technique didn't work previously, the installation of uswsusp might make it work now. If not, try the shutdown menu.

To resume from suspend, a keypress is required; opening the lid won't do it. Press a key, wait a minute, and then move your finger around the mouse pad until the password login prompt appears. Your operating system should be configured to lock the screen when it goes into hibernate/suspend states. (System Settings > Advanced > Power Management > Profiles > Actions > "When Laptop Lid is Closed.") You'll have to check each profile to make sure that Lock Screen is selected; if not, select it.

  • + Share This
  • 🔖 Save To Your Account