Edit grub2 kernel parameters (hibernate/resume) [Solved]

Issues Related to Hardware (Sound, Video, Printers, Scanners, Webcams, Touchpads, Keyboards, Sensors, Drives, GRUB, etc.)

Moderator: Moderators

Edit grub2 kernel parameters (hibernate/resume) [Solved]

Postby udiljak » Sun Jan 22, 2012 20:28

Hi.

Since I reorganized some of my partitions, the swap partition changed. It was no problem to tell the system to use it (swapon /dev/sdb7).

But: If I want to use hibernation I have to adjust the kernel parameter 'resume=swap:/dev/sdb7'.

I found the file /etc/default/sabayon-grub. When I edit this file IT WORKS and I can resume from hibernation, but in this file a comment tells me not to edit it directly:

# this file has been added by the Anaconda Installer
# containing default installer bootloader arguments.
# DO NOT EDIT NOR REMOVE THIS FILE DIRECTLY !!!

So what else is the proper way to do this???

Thanks for an answer!
Ben
Last edited by udiljak on Wed Feb 29, 2012 23:36, edited 1 time in total.
udiljak
Young Hen
 
Posts: 27
Joined: Sat Nov 27, 2010 17:18

Re: Edit grub2 kernel parameters (hibernate/resume)

Postby Fitzcarraldo » Sun Jan 22, 2012 21:07

Add it to the file /etc/default/grub
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7335
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Edit grub2 kernel parameters (hibernate/resume)

Postby Fitzcarraldo » Wed Feb 29, 2012 22:48

Just came upon this when looking for something else and realised I assumed you knew what to do after that. If you don't, the correct way is to add it to the relevant section in /etc/default/grub thus:

Code: Select all
# Add your extra parameters here below
# Dear user, put your boot flags here ;-)
GRUB_CMDLINE_LINUX_DEFAULT="resume=swap:/dev/sdb7"
# ATTENTION ATTENTION ATTENTION
# DO NOT EDIT THIS MANUALLY NOR SET IT TO EMPTY IF IT'S ALREADY FILLED WITH
# SOMETHING (DONE BY THE INSTALLER). REALLY, DON'T !
GRUB_CMDLINE_LINUX=""
# ATTENTION ATTENTION ATTENTION


Ubuntu Community Documentation wrote:GRUB_CMDLINE_LINUX
Entries on this line are added to the end of the 'linux' command line (GRUB legacy's "kernel" line) for both normal and recovery modes. It is used to pass options to the kernel.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
This line imports any entries to the end of the 'linux' line (GRUB legacy's "kernel" line). The entries are appended to the end of the normal mode only.
To view a black screen with boot processes displayed in text, remove "quiet splash". To see the grub splash image plus a condensed text output, use "splash".

Then you have to run:

Code: Select all
grub-mkconfig -o /boot/grub/grub.cfg
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7335
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Edit grub2 kernel parameters (hibernate/resume)

Postby udiljak » Wed Feb 29, 2012 23:19

Hi Fitzcarraldo.

Thank you for your answers. After it worked with the file sabayon-grub I didn't try your proposal yet.

One question:
The content of the file 'sabayon-grub' is obviously appended to the GRUB_CMDLINE_LINUX variable. So I would assume that I have 'resume=swap/dev/xxx' two times on the kernel command line. Do I have to delete the parameter in 'sabayon-grub'?

Cheers!
Ben
udiljak
Young Hen
 
Posts: 27
Joined: Sat Nov 27, 2010 17:18

Re: Edit grub2 kernel parameters (hibernate/resume)

Postby Fitzcarraldo » Wed Feb 29, 2012 23:27

Oh, if you've already done it via sabayon-grub then that's fine. No need to do anything else. All is good. (Yes, you probably would have it two times.)
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7335
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Edit grub2 kernel parameters (hibernate/resume) [Solved]

Postby udiljak » Wed Feb 29, 2012 23:37

Thanks!
udiljak
Young Hen
 
Posts: 27
Joined: Sat Nov 27, 2010 17:18


Return to Hardware

Who is online

Users browsing this forum: No registered users and 1 guest