Is it possible to:
- hibernate Ubuntu,
- run secondary OS (say Windows 7),
- shut down secondary OS,
- resume hibernated Ubuntu,
or not? Ubuntu should (AFAIK) hibernate to SWAP partition, which is not used by Windows. Would it work? If not, why?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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
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