hibernation with 12.04 wubi - any way?
I am using a Ubuntu installation with wubi since a week, it works nicely. I can do everything I need, did not have to start-up Windows for several days, now.
However, traveling means depending on battery, and they tend to run out of power. When the system shuts down, all open things are lost, a major pain. Hibernation is the way to overcome that (restart using another battery, or power source).
I know, hibernation is not supported with wubi out of the box.
(see my tries so far in http://
Is there any way to make it work?
Some ways to try may include e,g.:
- use a real swap partition of the right size
- use TuxOnIce
- ???
Did anyone try to get hibernation to work in wubi?
Or - is the only way moving Ubuntu to its own partition? If so, how to do that without loosing data (and access to them) in both, Windows and Ubuntu?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Wubi Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- bcbc
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
You can hibernate with a swap partition (basic steps outlined here: http://
Revision history for this message
|
#2 |
Thank you for the links and advices, I followed your recommendation to move to a dual boot:
I used your script to move the wubi install to a new partition, also created a swap partition, and got the grub..
It took some time, but everything seemed to go well. Ubuntu booted from the new partition.
Unfortunately, the Windows data were not accessible anymore. I solved that by editing fstab.
More difficult is that I can no longer boot Windows, it directly starts up Ubuntu.
I guess, grub starts from the small recovery partition at the very beginning of the drive, and does not see Windows on the second partition.
So far, I could not test the hibernation. I tried s2disk, but got an error message about the swap being not accessible.
Any ideas or links which can help me here?
Revision history for this message
|
#3 |
P.S.: the message from s2disk was: "Could not use the resume device (try swapon -a). Reason: No such device"
Revision history for this message
|
#4 |
I recommend running the bootinfoscript and posting the RESULTS.txt on pastebin, then copying the pastebin link here. You can get the bootinfoscript at http://
(Note: the instructions are a bit out of date in that link - it's "sudo bash bootinfoscript" (you need to drop the .sh))
That will help me see what is going on.
You can also try running the following to update your grub menu:
sudo update-grub
(but the migration script should have picked up Windows).
After that we can look at why the hibernation issue isn't working by posting the results of the following commands:
cat /etc/fstab
sudo blkid
cat /etc/initramfs-
(The first two commands will already be in the bootinfoscript so if you've posted that, just give me the last one)
Thanks
Revision history for this message
|
#5 |
Thanks for replying so fast.
in short:
- pastebin link of the bootinfoscript results: http://
- sudo update-grub did not change the behavior
- initramfs-
Revision history for this message
|
#6 |
Because you set the Wubi install to be the default, it affects how Grub sees Windows. Grub is actually extracting it from the "Default" entry in the boot.ini, and since the default is "Ubuntu", that's what it displays.
So when you see: "Ubuntu (on /dev/sda2)" that's actually Windows, and selecting that will lead to your Windows boot manager screen with Ubuntu/Windows, so just select Windows from there and it should boot. Then go to your Startup & Recovery settings on Windows and change the default OS back to Windows, and then reboot into Ubuntu (migrated) and run "sudo update-grub" and it will change the menuentry to something like "Windows XP (on /dev/sda2)"
I'll post some more info on the hibernate thing soon. Please post the output of the following commands as well:
swapon -s
free
Thanks
Revision history for this message
|
#7 |
I figure you have 3.45GB of Swap, so that should exceed the size of your RAM in order to hibernate.
You can look at syslog to see any error messages:
cat /var/log/syslog | grep PM:
Make sure you test hibernation using this:
sudo pm-hibernate
Don't use s2disk.
To enable the Hibernate option on the system menu refer to this:
http://
Revision history for this message
|
#8 |
Thank you! That's a nice feature of grub, very disturbing. I'll try that tomorrow morning (booting Windows takes long time).
swapon -s
Filename Type Size Used Priority
/dev/sda5 partition 3375364 78156 -1
free
Mem: 1267952 1146356 121596 0 46748 620180
-/+ buffers/cache: 479428 788524
Swap: 3375364 78152 3297212
syslog has some PM: entries at system start-up:
Jun 26 20:06:07 ubuntu kernel: [ 0.000000] PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
Jun 26 20:06:07 ubuntu kernel: [ 0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000e0000
Jun 26 20:06:07 ubuntu kernel: [ 0.000000] PM: Registered nosave memory: 00000000000e0000 - 0000000000100000
Jun 26 20:06:07 ubuntu kernel: [ 0.096005] PM: Registering ACPI NVS region at 4efcf000 (200704 bytes)
Jun 26 20:06:07 ubuntu kernel: [ 0.714609] PM: Hibernation image not present or could not be loaded.
Jun 26 20:06:07 ubuntu kernel: [ 2.713167] PM: Marking nosave pages: 000000000009f000 - 0000000000100000
Jun 26 20:06:07 ubuntu kernel: [ 2.713173] PM: Basic memory bitmaps created
Jun 26 20:06:07 ubuntu kernel: [ 2.738672] PM: Basic memory bitmaps freed
-----------
suspend-log has:
<...>
Running hook /usr/lib/
Having NetworkManager put all interaces to sleep...Failed.
/usr/lib/
<...>
Running hook /usr/lib/
stop: Unknown instance:
/usr/lib/
<...>
Running hook /etc/pm/sleep.d
/novatel_3g_suspend hibernate hibernate:
/etc/pm/
Tue Jun 26 15:04:27 CST 2012: performing hibernate
s2disk: Could not use the resume device (try swapon -a). Reason: No such device
Tue Jun 26 15:04:28 CST 2012: Awake.
Tue Jun 26 15:04:28 CST 2012: Running hooks for thaw
Running hook /etc/pm/
I'll try that again tomorrow.
Revision history for this message
|
#9 |
For the boot issue, you were right. I started up the "Ubuntu (on /dev/sda2)" - and the Windows boot loader came up. Then changed the sequence in Windows, in Ubuntu updated grub.
The boot issue is solved. Thank you!
For the hibernation issue, it seems, the system does not recognize - or cannot access - the swap partition at the time almost everything else was shut down successfully.
The error messages in syslog (at start-up) and pm-suspend.log (at pm-hibernate) point to problems with the swap.
In Windows, a special hibernation file needs to be prepared in advance. How is that done in Ubuntu?
Revision history for this message
|
#10 |
It is possible to hibernate with a swap file but it's not the supported way. I can point you at a howto, but can't help you with it beyond that since I've never tried it.
I know that you cannot hibernate with an encrypted swap partition (that doesn't seem to be the case here, and you'd know if it was). But other than that I can't understand why it wouldn't work... you have the resume file setup correctly, the swap is active, much bigger than your RAM, configured correctly in /etc/fstab - so this is puzzling.
After running "sudo pm-hibernate" please post the results of "cat /var/log/syslog | grep PM:" again.
If you've made any edits to /etc/default/grub please post that as well.
PS here is a link to that howto I mentioned - it appears to have been updated last in September 2011 - disclaimer: please don't take the posting of a link as a recommendation or any guarantee that it will work: http://
Revision history for this message
|
#11 |
Again, thank you for your time and efforts.
"you have the resume file setup correctly":
How to check that? I am not aware that I created/setup that resume file.
hartwig@ubuntu:~$ sudo pm-hibernate
[sudo] password for hartwig:
hartwig@ubuntu:~$ cat /var/log/syslog | grep PM:
Jun 28 13:26:51 ubuntu kernel: [18394.009859] PM: Marking nosave pages: 000000000009f000 - 0000000000100000
Jun 28 13:26:51 ubuntu kernel: [18394.009866] PM: Basic memory bitmaps created
Jun 28 13:26:51 ubuntu kernel: [18394.018413] PM: Basic memory bitmaps freed
hartwig@ubuntu:~$
what I am concerned about is the entry in /var/log/
Thu Jun 28 13:26:51 CST 2012: performing hibernate
s2disk: Could not use the resume device (try swapon -a). Reason: No such device
Thu Jun 28 13:26:51 CST 2012: Awake.
I tried some grub settings using Grub Customizer:
/etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT="0"
GRUB_HIDDEN_
GRUB_HIDDEN_
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTO
GRUB_CMDLINE_
GRUB_CMDLINE_
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM=
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_
# Uncomment to get a beep at grub start
#GRUB_INIT_
export GRUB_MENU_
export GRUB_COLOR_
export GRUB_COLOR_
GRUB_FONT=
I will also have a look at the link you gave me.
Revision history for this message
|
#12 |
You posted the contents of the resume file:
initramfs-
I'll have a look at this later today.
Revision history for this message
|
#13 |
I noticed that in post 1 you mentioned following instructions from http://
So I think you should reverse any of the changes you made. Hopefully you backed up all files you changed.
Just FYI this is the output of my pm-suspend log for one hibernate/thaw:
Initial commandline parameters:
Thu Jun 28 00:24:29 PDT 2012: Running hooks for hibernate.
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
Linux neptune 3.2.0-25-generic #40-Ubuntu SMP Wed May 23 20:30:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Module Size Used by
ipt_MASQUERADE 12759 1
iptable_nat 13229 1
nf_nat 25891 2 ipt_MASQUERADE,
nf_conntrack_ipv4 19716 3 iptable_nat,nf_nat
nf_conntrack 81926 4 ipt_MASQUERADE,
dm_crypt 23125 0
nf_defrag_ipv4 12729 1 nf_conntrack_ipv4
ip_tables 27473 1 iptable_nat
x_tables 29846 3 ipt_MASQUERADE,
bnep 18281 2
bridge 90989 0
stp 12931 1 bridge
rfcomm 47604 0
bluetooth 180104 10 bnep,rfcomm
bbswitch 13396 0
parport_pc 32866 0
ppdev 17113 0
snd_hda_codec_hdmi 32474 1
joydev 17693 0
snd_hda_
binfmt_misc 17540 1
snd_hda_intel 33773 3
arc4 12529 2
uvcvideo 72627 0
snd_hda_codec 127706 3 snd_hda_
videodev 98259 1 uvcvideo
psmouse 87692 0
iwlwifi 332672 0
v4l2_compat_ioctl32 17128 1 videodev
snd_hwdep 13668 1 snd_hda_codec
snd_pcm 97188 3 snd_hda_
snd_seq_midi 13324 0
snd_rawmidi 30748 1 snd_seq_midi
snd_seq_midi_event 14899 1 snd_seq_midi
snd_seq 61896 2 snd_seq_
snd_timer 29990 2 snd_pcm,snd_seq
dell_laptop 18119 0
dcdbas 14490 1 dell_laptop
dell_wmi 12681 0
snd_seq_device 14540 3 snd_seq_
sparse_keymap 13890 1 dell_wmi
snd 78855 16 snd_hda_
soundcore 15091 1 snd
serio_raw 13211 0
mac80211 506816 1 iwlwifi
cfg80211 205544 2 iwlwifi,mac80211
mei 41616 0
snd_page_alloc 18529 2 snd_hda_
wmi 19256 1 dell_wmi
mac_hid 13253 0
lp 17799 0
parport 46562 3 parport_pc,ppdev,lp
i915 468745 4
r8169 62099 0
drm_kms_helper 46978 1 i915
drm 242038 5 i915,drm_kms_helper
i2c_algo_bit 13423 1 i915
video 19596 1 i915
total used free shared buffers cached
Mem: 6005648 2318304 3687344 0 102576 859496
-/+ buffers/cache: 1356232 4649416
Swap: 6180860 60548 6120312
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
Sessions still open, not unmounting
Sessions still open, not unmounting
Sessions still open, not unmounting
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> Sessions still open, not unmounting
Sessions still open, not unmounting
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> Sessions still open, not unmounting
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> Sessions still open, not unmounting
/usr/lib/
Running hook /etc/pm/
/etc/pm/
Running hook /etc/pm/
/etc/pm/
Running hook /usr/lib/
Having NetworkManager put all interaces to sleep...Failed.
/usr/lib/
Running hook /usr/lib/
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
Kernel modesetting video driver detected, not using quirks.
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /etc/pm/
/etc/pm/
Thu Jun 28 00:24:31 PDT 2012: performing hibernate
Fri Jun 29 07:20:07 PDT 2012: Awake.
Fri Jun 29 07:20:07 PDT 2012: Running hooks for thaw
Running hook /etc/pm/
/etc/pm/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/dev/sda:
setting Advanced Power Management level to 0x80 (128)
APM_level = 128
/dev/sda:
setting standby to 36 (3 minutes)
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
Reloaded unloaded modules.
/usr/lib/
Running hook /usr/lib/
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
/usr/lib/
Running hook /usr/lib/
Having NetworkManager wake interfaces back up...Failed.
/usr/lib/
Running hook /etc/pm/
/etc/pm/
Running hook /etc/pm/
/etc/pm/
Running hook /usr/lib/
Sessions still open, not unmounting
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> Sessions still open, not unmounting
Sessions still open, not unmounting
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> Sessions still open, not unmounting
Welcome to PulseAudio! Use "help" for usage information.
>>> >>> Sessions still open, not unmounting
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Running hook /usr/lib/
/usr/lib/
Fri Jun 29 07:20:09 PDT 2012: Finished.
Revision history for this message
|
#14 |
wow, it was uswsusp.
I installed it because it seemed to promise to be working with a swap file, like in a wubi installation. It did not work that way, and I do not have a wubi installation anymore.
I had it hibernate (save to swap and turn off) successfully, but the resume did not work, always resulted in a cold boot.
I purged uswsusp, and hibernation works now, including resume.
Thank you very much for your help!
Revision history for this message
|
#15 |
Thanks bcbc, that solved my question.