52
16
IMPORTANT
If you came here looking for an answer to this question, please read all the answers below. There are some testimonials from people who have lost data doing this. If you plan to do this regularly, I highly recommend that you test for yourself.
Original Question
Suppose I have Windows and Linux installed on the same computer. If I hibernate Windows, can I boot into Linux without corrupting the Windows filesystem when I resume Windows? What about the other way around? What if I hibernate one, boot into the other, and mount the hibernated filesystem read/write? Read-only? If this is unsafe, is there any way to detect the hibernated state of the other OS and prevent mounting its filesystem?
Basically, how far can I push this before it breaks, and how dangerous is it near the edge? I think I know the answers to some of the above questions, but for other ones, I have no idea, and for obvious reasons I have not tested this on my own computer. If someone has tested these, please enlighten the rest of us. I'm not necessarily looking for a specific answer to every question; I'll accept any response that answers a reasonable portion.
EDIT
Let me clarify that when I say "hibernate," I mean the process of writing the contents of RAM to the hard disk and completely powering down the computer. In this state, powering the computer back on brings you through the BIOS and bootloader again, and you could theoretically select another operating system on a multi-boot system. Anyway, on with the original question:
My Results
Ok, after everyone's assurances that this would work, I tested it for myself. I set up Ubuntu to remount all ntfs filesystems and external drives read-only before hibernating. There was no need for a similar Windows setup because Windows does not read Linux filesystems. Then, I tried alternately hibernating one operating system and resuming the other, back and forth a few times. I even tried mounting the Windows filesystem from Ubuntu read-write, and creating a few files. Windows didn't complain when I resumed. So, in conclusion, you can more or less freely hibernate in a dual-boot Windows/Linux scenario.
Note that I did not test a dual Linux/Linux co-hibernation situation. If you have two or more Linux installs and you hibernate one of them, you might be able to corrupt the filesystem by mounting it from another.
@RyanThompson, How would you test this reliably? Sure it may look like it's working, until it doesn't. – Pacerier – 2015-04-26T22:36:28.470
That's why I marked the "Don't do it you will lose data" answer as accepted. – Ryan C. Thompson – 2015-04-27T09:36:51.177
Did all work well for you in the years after asking the question? – Arjan – 2016-10-01T09:56:46.787
I never managed to sleep or hibernate Windows when booted from GRUB. Is this really possible? :D https://superuser.com/questions/487157/windows-wont-sleep-after-booting-from-grub
– inf3rno – 2017-03-23T05:50:22.5671I'd like to further clarify that I'm looking for someone who has actually tested these questions and similar one empirically. But, failing that, feel free to speculate. If no one has any real test results, I'll accept the most plausible speculation after a while. – Ryan C. Thompson – 2009-09-11T20:13:05.627
Well, I'm going to try to test some of these ideas soon. If I end up with a machine that still boots, I'll come back and accept an answer. ;) – Ryan C. Thompson – 2009-09-13T19:52:33.710
related: http://superuser.com/questions/211079/what-do-i-have-to-take-care-of-when-hibernating-both-ubuntu-and-windows-dual-bo
– David Cary – 2012-12-31T19:28:41.170