Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Moving to GRUB2 my Arch Linux no longer resumes from hibernation, because the actual resuming is no longer set up. In GRUB legacy I'd write:

/boot/grub/menu.lst:

kernel /vmlinuz26 root=/dev/disk/by-uuid/X ro resume=/dev/disk/by-uuid/Y ro

But with GRUB2's new way of handling the boot menu, I no longer know how, where and in which form to add this. My guess is you'd add the entire menuentry to /etc/grub.d/40_custom/ and somehow set up the resuming there? Manually hardcoding menuentries into GRUB2 seems to go against its flexible menu generation approach, but whatever reenables me to use hibernate is gladly welcomed.

Thanks!

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Open up /etc/default/grub with root privledges and add GRUB_CMDLINE_LINUX="resume=/dev/sdXY" Where XY is the swap partition location, which can be found by sudo fdisk -l. It looks like you are using UUID instead and that's fine. /etc/default/grub only affects the current operating system so don't worry about every linux OS using grub to start using that swap. After finishing your edits, run sudo grub-mkconfig -o /boot/grub/grub.cfg (substitute grub.cfg with whatever file grub reads at boot, e.g. it may be named /boot/grub/grub.efi) to update your grub startup information with what you changed in /etc/default/grub

(I don't think this needs to be done on Ubuntu)
Note that one may need to add a resume hook to make sure the kernel knows that it should resume if Archlinux or perhaps another OS is being used. To do this, if one is using mkinitcpio, go to /etc/mkinitcpio.conf and insert resume in the HOOKS array before filesystems but after ide, scsi, and sata. Then, you you need to rebuild the initial ramdisk(early OS state for loading modules, including resume) image by mkinitcpio -p linux

Other links that may help
http://askubuntu.com/questions/6769/hibernate-to-a-swap-file
https://wiki.archlinux.org/index.php/Pm-utils#Mkinitcpio_Resume_Hook

share|improve this answer
    
Thanks! Arch is now successfully back from hibernating again! –  miyalys Mar 29 '12 at 13:28
    
@xlys Glad I could help. Did you wait all these months to fix it? –  Azrathud Mar 30 '12 at 0:31
    
Yes, I did, and I left my computer on a lot more because of it. –  miyalys Mar 30 '12 at 11:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.