Saturday, October 1, 2011

Fixing suspend on my laptop permanently with grub2

I own a slightly aging Sony Vaio VGN-FW21E, which still is a nice piece of hardware, but has one quirk: it doesn't suspend right. It hasn't done so for the past four or five kernel releases and it still doesn't work properly :(

With older versions of Fedora (<16), it was easy to edit grub.conf (or menu.lst, whatever) and fix this problem by appending "acpi_sleep=nonvs" to the kernel line. With grub2, however, things have changed a bit.

To permanently add something to the kernel line to the grub2 configuration, you need to edit /etc/default/grub (which I consider to be an odd filename on a Fedora-based system) and edit the GRUB_CMDLINE_LINUX variable defined there. For me, it needs to read:

GRUB_CMDLINE_LINUX="quiet rhgb acpi_sleep=nonvs"

If you would like to have a more verbose kernel during boot, or disable Plymouth, you could remove the "quiet" and "rhgb" keywords respectively.


Bhavya Juneja said...

do we need to edit /etc/default/grub or /etc/default/grub.rpmnew

i edited grub.rpmnew followed by grub-mkconfig but it didn't work...any ideas?

Maxim Burgerhout said...

That would be /etc/default/grub, not the rpmnew one. The rpmnew file is put there by an RPM that updated grub, but didn't want to overwrite your local modifications to /etc/default/grub.

The non-rpmnew file is *always* the file that is actually used by a program. From time to time, you should diff the rpmnew file with the non-rpmnew file and check what differences there are. You might find new options or new defaults in the rpmnew file you need to incorporate in your own version (the non-rpmnew file).

Bhavya Juneja said...

thanks for the tip...but this didn't work out for me....

can you post the content of your non-rpmnew file

-cedric said...

After updating your /etc/default/grub, you ALWAYS need to enact the changes by running: sudo update-grub
in a Terminal window.

You also might want to reboot.