Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to:

  1. hibernate Ubuntu,
  2. run secondary OS (say Windows 7),
  3. shut down secondary OS,
  4. resume hibernated Ubuntu,

or not? Ubuntu should (AFAIK) hibernate to SWAP partition, which is not used by Windows. Would it work? If not, why?

share|improve this question
    
FWIK it should work, if the secondary OS will not change things that survive a reboot (like for example NVRAM configuration). For most safety, I would power off (not reboot) in step 3. –  Rmano Mar 31 at 19:11
    
reference: superuser.com/questions/39532/… –  Rinzwind Mar 31 at 19:14
    
Would any of the drives used by Ubuntu be mounted by Windows? For myself, I run Ubuntu as my primary OS and run Windows when I need it in a VirtualBox VM. It probably slows windows down some but it is actually fairly reliable and I can switch back and forth quickly. I am however running windows XP which needs less RAM... –  maddentim Apr 1 at 12:42
    
@maddentim: No the OSes would be completely separate. I do run Windows in virtualbox myself, but I intend to do some gaming, which is why I need dualboot. –  mreq Apr 1 at 16:38

2 Answers 2

Absolutely it should work. I was doing that ages for gaming purposes as well, although now with the Steam-Linux revolution I haven't booted Windows up for months.

I had my OS partitions totally separate, as you intend to, and had no problems at all. There were no shared partitions. My swap partition is 36 GB, slightly more than twice my RAM (16 GB).

The only problem is that hibernate is slightly unstable on Linux sometimes. Probably 20% of the time, it would crash when hibernating or resuming. (This was a year ago, so things might have changed, or be different on your system. After I bought an SDD, and startup time were reduced greatly, I just restarted instead of hibernating.)

I even have a script that might be useful. You might need to change the name and location of the Windows partition.

#!/usr/bin/env bash
# hibernate and restart in Windows for only the next time.
# requires /etc/default/grub has "GRUB_DEFAULT=saved"

# get the correct name from /boot/grub/grub.cfg
sudo grub-reboot "Windows 7 (loader) (on /dev/sdb2)"

# or use the number, i.e.
# WINDOWS_ENTRY=`grep menuentry /boot/grub/grub.cfg  | grep --line-number Windows`
# MENU_NUMBER=$(( `echo $WINDOWS_ENTRY | sed -e "s/:.*//"` - 1 ))
# sudo grub-reboot $MENU_NUMBER

sudo dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate

# if this fails, you can try ---> sudo pm-hibernate
share|improve this answer

I am probably repeating similar answers, but It should be possible as long as where your hibernation files are saved is separate from, as in your example Windows 7. (Windows 7 likes to take control of the partition, or disk it is on, so it is best to keep Ubuntu to it's own area anyway).

I would test just a regular hibernation with a hard reset (or maybe even pull the plug/battery), and see if you can recover your hibernation "before-state" from that.

For more on hibernation for Ubuntu I looked here: https://help.ubuntu.com/community/PowerManagement/Hibernate

share|improve this answer

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.