Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] TuxOnIce + Hibernate Suspend Problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Sun Oct 28, 2012 9:46 am    Post subject: [SOLVED] TuxOnIce + Hibernate Suspend Problem Reply with quote

Hi, I have my system encrypted with LUKS and I also use LVM, but this isn't the point of discussion here. The point is that I can't get my hibernate to work correctly.

I'm using TuxOnIce kernel and it's working fine. To prove that I can present the output of uname -a:
Quote:

# uname -a
Linux localhost 3.0.35-tuxonice #1 SMP PREEMPT Fri Oct 26 06:46:20 Local time zone must be set-- x86_64 Intel(R) Core(TM)2 Duo CPU P8800 @ 2.66GHz GenuineIntel GNU/Linux


The /etc/hibernate/tuxonice.conf contains the following:
Quote:

UseTuxOnIce yes
Reboot no
EnableEscape yes
DefaultConsoleLevel 1
Compressor lzf
Encryptor none
FilewriterLocation /root/suspend_file 4096
VerifyFilewriterResume2 yes
FullSpeedCPU yes
Include common.conf


My grub.conf contains this:
Quote:

default 0
timeout 5

title=Gentoo
root (hd0,0)
kernel /boot/kernel-tuxonice-3.0.35 root=/dev/sda3 elevator=noop splash resume=UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458
initrd /boot/initramfs.cpio.gz


The resume parameter was obtained through these commands:
Quote:

# echo /root/suspend_file > /sys/power/tuxonice/file/target
# cat /sys/power/tuxonice/resume
UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458



As you can see I'm using suspend to dedicated file that is located at /root/suspend_file, which is on the /dev/sda3 partition that is LUKS encrypted + uses the LVM. This is why the actual partition the suspend_file is saved on is mapped through the /dev/mapper/vg-root.


When executing hibernate script, I get the following errors:
Quote:

# tail -f /var/log/hibernate.log
hibernate: [01] Executing CheckLastResume ...
hibernate: [01] Executing CheckRunlevel ...
hibernate: [01] Executing LockFileGet ...
hibernate: [01] Executing NewKernelFileCheck ...
hibernate: [10] Executing EnsureTuxOnIceCapable ...
hibernate: [11] Executing TuxOnIceSetupFilewriter ...
hibernate: Detected filewriter image ready for use.
ABORTING: resume is not setup correctly. Unless you have setup your bootloader
correctly, resuming will most likely fail. To correct this, add
"resume=UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458" to your kernel command line in your
LILO or GRUB configuration file and reboot.
hibernate: TuxOnIceSetupFilewriter refuses to let us continue.
hibernate: Aborting.
hibernate: [11] Executing XHacksResumeHook1 ...
hibernate: [11] Executing TuxOnIceCleanupFilewriter ...
hibernate: [01] Executing NoteLastResume ...
hibernate: [01] Executing LockFilePut ...



Does anybody have any idea why the hibernate is not working correctly?


Last edited by eleanor on Fri Nov 09, 2012 10:12 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13998

PostPosted: Sun Oct 28, 2012 4:29 pm    Post subject: Reply with quote

/usr/share/hibernate/scriptlets.d/tuxonice:
   797       new_resume2="`cat $TUXONICE_ROOT/$RESUME2_FILE`"
   803       if ! grep "$new_resume2" /proc/cmdline ; then
   804      filewriter_target=`cat $TUXONICE_ROOT/$RESUME2_FILE`
   805      vecho 0 "ABORTING: $RESUME2_FILE is not setup correctly. Unless you have setup your bootloader"
   806      vecho 0 "          correctly, resuming will most likely fail. To correct this, add"
   807      vecho 0 "          \"$RESUME2_FILE=$filewriter_target\" to your kernel command line in your"
   808      vecho 0 "          LILO or GRUB configuration file and reboot."
   809      return 2 # abort even if forced
   810       fi
   811   
   812       return 0

What is the output of cat /proc/cmdline?
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Sun Oct 28, 2012 7:03 pm    Post subject: Reply with quote

Hi,

The /proc/cmdling contains the following:

Quote:

# cat /proc/cmdline
root=/dev/sda3 ikmap=slovene.bin elevator=noop splash resume=UUID=ff446f4b3a97486689804ec8f520e303:60e9458


I've also tried using the 0x60e9458 at the end, but the same result, with some changes: I also get this error:
Quote:

TuxOnIce: Can't translate "UUID=ff446f4b3a97486689804ec8f520e303" into a device id yet.



If I execute hibernate I get the following errors:

Quote:

hibernate: [01] Executing CheckLastResume ...
hibernate: [01] Executing CheckRunlevel ...
hibernate: [01] Executing LockFileGet ...
hibernate: [01] Executing NewKernelFileCheck ...
hibernate: [10] Executing EnsureTuxOnIceCapable ...
hibernate: [11] Executing TuxOnIceSetupFilewriter ...
hibernate: Detected filewriter image ready for use.
ABORTING: resume is not setup correctly. Unless you have setup your bootloader
correctly, resuming will most likely fail. To correct this, add
"resume=UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458" to your kernel command line in your
LILO or GRUB configuration file and reboot.
hibernate: TuxOnIceSetupFilewriter refuses to let us continue.
hibernate: Aborting.
hibernate: [11] Executing XHacksResumeHook1 ...
hibernate: [11] Executing TuxOnIceCleanupFilewriter ...
hibernate: [01] Executing NoteLastResume ...
hibernate: [01] Executing LockFilePut ...



Any ideas?
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2522
Location: Canada

PostPosted: Sun Oct 28, 2012 7:21 pm    Post subject: Reply with quote

But overall how is tuxonice supposed to read from encrypted file ? I'd be interested to learn.
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Sun Oct 28, 2012 7:27 pm    Post subject: Reply with quote

This is what I'm trying to learn. In the initrd I'm decrypting the system partition that contains a file /root/suspend_file, which is our hibernation file, so at the time of hibernation that is already decrypted. If you have any interesting ideas/insights please share them.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13998

PostPosted: Sun Oct 28, 2012 7:32 pm    Post subject: Reply with quote

According to the hibernation snippet posted above, if the command line does not contain the text from the resume file, then the hibernation script will refuse to continue. The output provided indicates that the difference is the presence of the 0x, as the OP noted. It is odd that the grub.conf entry cited in the first post appears to have the required prefix, but the cmdline shown in the running system does not.

Is there a reason you chose to use the file writer instead of a swap partition? The swap partition is usually easier to configure.
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Sun Oct 28, 2012 7:39 pm    Post subject: Reply with quote

The problem is that the swap partition is also contained in the LVM + LUKS and also encrypted ant it's only 2GB (and my RAM is 4GB), so I would have to enlarge it.

I've made some progress. I've seen the TuxOnIce console when executing "hibernate" command, but the hibernation is still not working the way it should. The booting process says this:

Quote:

# dmesg | grep TuxOnIce
[ 2.257953] TuxOnIce 3.2 (http://tuxonice.net)
[ 2.710606] TuxOnIce: Can't translate "UUID=ff446f4b3a97486689804ec8f520e303" into a device id yet.



I guess the only thing needs to be done now is to persuade kernel to know how to translate the UUID. Any ideas about how to do that?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13998

PostPosted: Sun Oct 28, 2012 9:41 pm    Post subject: Reply with quote

No. I use a swap device, rather than swap files.
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Sun Oct 28, 2012 9:55 pm    Post subject: Reply with quote

Do you use encrypted swap partition? If yes, can you post your grub.conf to see how you've specified the resume parameter? Do you also use initrd, care to share the /init script?

Thanks
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13998

PostPosted: Mon Oct 29, 2012 3:20 am    Post subject: Reply with quote

My swap is inside an LVM, so yes. My initramfs automatically picks up the right volume, so there is nothing on the grub.conf line to control it.
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Mon Oct 29, 2012 8:42 am    Post subject: Reply with quote

Hi,

Okey, I decided I'll setup the swap partition instead. I've edited my grub.conf, which now looks like this:

Quote:

title=Gentoo
root (hd0,0)
kernel /boot/kernel-tuxonice-3.0.35 root=/dev/sda3 elevator=noop splash resume=swap:/dev/mapper/swap
initrd /boot/initramfs.cpio.gz


The problem that I'm having is this:

Quote:

ABORTING: grep UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458 /proc/cmdline resume is not setup correctly. Unless you have setup your bootloader
correctly, resuming will most likely fail. To correct this, add
"resume=UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458" to your kernel command line in your
LILO or GRUB configuration file and reboot.
hibernate: TuxOnIceSetupFilewriter refuses to let us continue.
hibernate: Aborting.
hibernate: [11] Executing XHacksResumeHook1 ...
hibernate: [11] Executing TuxOnIceCleanupFilewriter ...
hibernate: [01] Executing NoteLastResume ...
hibernate: [01] Executing LockFilePut ...



This happens because the /sys/power/tuxonice/resume contains the settings from before (when I was trying to configure suspending to a file):
Quote:

# cat /sys/power/tuxonice/resume
UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458


But even if I echo the right contents to the /sys/power/tuxonice/file/target, the /tuxonice/resume doesn't change:
Quote:

# echo "swap:/dev/mapper/vg-swap" > /sys/power/tuxonice/file/target
# cat /sys/power/tuxonice/resume
UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458



My question is: what and where to I have to echo "swap:/dev/mapper/vg-swap" in order for resume file to change. And it should change, because the hibernate script is greping the output from that file comparing it to the /proc/cmdline, which is correct:

Quote:

# cat /proc/cmdline
root=/dev/sda3 elevator=noop splash resume=swap:/dev/mapper/vg-swap



Any ideas ?
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2522
Location: Canada

PostPosted: Mon Oct 29, 2012 2:20 pm    Post subject: Reply with quote

Just to check, is kernel option for support for swap partition for the image is set ?
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Mon Oct 29, 2012 2:55 pm    Post subject: Reply with quote

Hi, can you be more specific, which option is that?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Mon Oct 29, 2012 4:00 pm    Post subject: Reply with quote

elenor ...

I think dmpogo means CONFIG_TOI_SWAP.

best ... khay
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Mon Oct 29, 2012 4:21 pm    Post subject: Reply with quote

Yeah, CONFIG_TOI_SWAP is set. The problem is still not solved. I'm not really sure how to persuade the hibernate script to accept the swap partition for suspending to.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13998

PostPosted: Tue Oct 30, 2012 1:59 am    Post subject: Reply with quote

Have you tried rebooting? You need to reboot at some point to confirm that the modified grub.conf will result in a hibernation-capable kernel, so you may as well reboot now to ensure that you are testing the same thing that you will use in the future.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Tue Oct 30, 2012 4:00 am    Post subject: Reply with quote

eleanor ...

I'm somewhat strapped for time currently and so don't really have the capacity to respond adequitly. However, IRT both this and your other thread re LVM & luks, it might be worth your while taking a close look at better-initramfs. It supports LVM, dmcrypt/luks, and TuxOnIce. Its easy to build, setup, and if your really want to "DIY" may offer some clues as to the issues your having.

best ... khay
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Tue Oct 30, 2012 9:40 am    Post subject: Reply with quote

Hu_, yes of course I rebooted. And I found the problem. Look at this:

Quote:

# cat /sys/power/tuxonice/resume
/dev/mapper/vg-swap

# hibernate
ABORTING: grep UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458 /proc/cmdline resume is not setup correctly. Unless you have setup your bootloader
correctly, resuming will most likely fail. To correct this, add
"resume=UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458" to your kernel command line in your
LILO or GRUB configuration file and reboot.
hibernate: Aborting.

# cat /sys/power/tuxonice/resume
UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458


It appears that the hibernate script changes the /sys/power/tuxonice/resume, but I'm not sure why. The value in the resume file was correct before running the hibernate script.


As it goes for the better-initramfs thanks for the link, I didn't know it existed. But I've got a problem making it work even for LUKS+LVM. I received the following error during booting:

Quote:

cryptsetup unknown action
cryptsetup --allow-discards luksOpen /dev/sda3 enc_root failed


The problem I observed is the following: the LVM part is happening before LUKS which is wrong and the luksOpen never asked me to enter the password, which it should, because how otherwise could it decrpt the partition. My current grub.conf entry is as follows:

Quote:

title=GentooTest
root (hd0,0)
kernel /boot/kernel-tuxonice-3.0.35 root=/dev/sda3 ikmap=slovene.bin elevator=noop splash luks enc_root=/dev/sda3 lvm root=/dev/mapper/vg-root rootfstype=xfs luks_trim tuxonice resume=/dev/mapper/vg-swap
initrd /boot/initramfsA.cpio.gz



Any idea about either one of the problems?
Back to top
View user's profile Send private message
188562
Apprentice
Apprentice


Joined: 22 Jun 2008
Posts: 186

PostPosted: Tue Oct 30, 2012 9:41 am    Post subject: Reply with quote

khayyam wrote:
eleanor ...

I'm somewhat strapped for time currently and so don't really have the capacity to respond adequitly. However, IRT both this and your other thread re LVM & luks, it might be worth your while taking a close look at better-initramfs. It supports LVM, dmcrypt/luks, and TuxOnIce. Its easy to build, setup, and if your really want to "DIY" may offer some clues as to the issues your having.

best ... khay


better-initramfs - BSD License? Thx ;)

Better I read early userspace mounting I'm gonna go build my own theme park, with blackjack and hookers
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Tue Oct 30, 2012 2:30 pm    Post subject: Reply with quote

eleanor wrote:
The problem I observed is the following: the LVM part is happening before LUKS which is wrong and the luksOpen never asked me to enter the password, which it should, because how otherwise could it decrpt the partition. My current grub.conf entry is as follows:

Code:
title=GentooTest
root (hd0,0)
kernel /boot/kernel-tuxonice-3.0.35 root=/dev/sda3 ikmap=slovene.bin elevator=noop splash luks enc_root=/dev/sda3 lvm root=/dev/mapper/vg-root rootfstype=xfs luks_trim tuxonice resume=/dev/mapper/vg-swap
initrd /boot/initramfsA.cpio.gz

eleanor ... your passing "root=" twice, the first is /dev/sda3 and the second the LVM /dev/mapper/vg-root, remove the former and it should work as expected.

best ... khay
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Wed Oct 31, 2012 7:46 pm    Post subject: Reply with quote

Hi,

I've already solved my problem by using swsusp with better-initramfs and my boot.conf not contains the following:

Code:

title=GentooHibernate
root (hd0,0)
kernel /boot/kernel-3.4.9 root=/dev/sda3 elevator=noop splash luks enc_root=/dev/sda3 lvm root=/dev/mapper/vg-root rootfstype=xfs swsusp resume=/dev/mapper/vg-swap acpi_osi=Linux luks_trim
initrd /boot/initramfsA.cpio.gz
Back to top
View user's profile Send private message
maxmoon
n00b
n00b


Joined: 05 Apr 2015
Posts: 1

PostPosted: Sun Apr 05, 2015 11:21 am    Post subject: Re: [SOLVED] TuxOnIce + Hibernate Suspend Problem Reply with quote

[Sorry for awakening a fossile, but this could help others]

Hi,

I had exactly the same issue with hibernate to file on an ecrypted disk.

My solution was to put a file: flag in the resume line!

Instead of:
Code:
resume=UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458


You should use:
Code:
resume=file:UUID=ff446f4b3a97486689804ec8f520e303:0x60e9458


And remember! Put the resume flag in /etc/mkinitcpio.conf after decrypting the disk.

Greetings

maxmoon
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum