Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
1  
I'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 Thompson Sep 11 '09 at 20:13
    
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 Thompson Sep 13 '09 at 19:52
    
related: superuser.com/questions/211079/… –  David Cary Dec 31 '12 at 19:28
add comment

14 Answers 14

up vote 6 down vote accepted

Booting Windows over an hibernated Linux is not a good idea. I just lost 20 GiB of data in a shared NTFS partition...

I hibernated Ubuntu Lucid one day, and the next I fired up my computer. Some update messed up the saved option in Grub, so instead of booting Ubuntu again as it should, it started Windows 7. When I came back with my coffee, I just went on using it without recalling Ubuntu was in bear mode. I probably accessed music, Firefox profile, documents, downloads and games from the shared partition.

The next time I switched to Ubuntu, I saw the "waking up from hibernation" message. Dang. But I expected it to fail at waking, and soft reboot instead, as happened the previous time I "tried" this (in my Karmic times). But no, it woke up alright. Cool. Or not. I quickly realized a directory in the root of the shared partition was now empty. I think the only programs accessing the shared partition on resuming were Quod Libet (music player) and Transmission (bittorrent client).

I went back to Windows, where I couldn't even open the directory. Trying to "dir" it in shell produced "file not found". Corrupted. Still, the partition's free space had not increased, so my 20 GiB where probably still there, safe from being overwritten. Maybe. But how to get to them?

A little research provided little help, and made my hopes even more bleak.

I ran Scandisk ("Check for Errors") without auto repair, since I don't wanted to risk it fixing things by further destroying my data. The result was not very informative: "Errors found. Run with auto repair." Unknown to me, seemingly it also marked the partition to be automatically checked on next boot. I powered off and went away, and came back with EasyRecovery later.

The computer started with me not paying attention, as usual, and when I looked, chkdsk was already spewing errors in full swing, which it did for some ten minutes. Oh well, here goes nothing.

Fortunately I did lit a candle for Santa Tecla recently, and after Windows started, my data was back, all of it as far as I can tell, though some files ended up in found.000.

So yes, this had a happy ending. You'll forgive the dramatic suspense, but that's to drive a point across: backup your data! And (in my case) keep the backup up to date! And of course, be extra careful with hibernation and shared partitions...

share|improve this answer
3  
I'm going to mark this as the accepted answer just to err on the side of caution for new users reading this question. –  Ryan Thompson May 2 '10 at 5:54
    
Updates caused by one OS affecting the other are rather normal and are not actually caused by issues with hibernation. The hibernation state is treated as any other file on the filesystem. Can't quite see why this answer was accepted. –  Matt H Dec 6 '11 at 8:09
1  
A whole directory dissapearing into FAT limbo is not an "update caused by one OS," not an intentional one at least. I experienced data corruption in a shared NTFS partition after hibernating Linux, booting Windows, then waking up Linux, simple as that. –  Chema Feb 2 '12 at 22:22
1  
Hibernating one OS and mounting the same partition in another is effectively having two operating systems access the disk at the same time. They don't know about changes the other one has made so corruption will result. –  psusi Sep 29 '13 at 3:02
    
Agreed. Except it's not at the same time. I would think it technically possible to perform a lazy-then-forced umount on hibernation (on shared drives), and then synchronize filesystems/flush journaling buffers/xpark the drive/whatever they call it today, hence leaving it in a clean state. This would probably require some fancy new dance moves in every program, like "finish up quickly, then prepare to resume where you left off... if you can"; mobile OSes and programs seem to do this. Wait a minute... /me goes off to hibernate and reboot to Windows 8 –  Chema May 17 at 9:55
add comment

I just don't think this is possible.

When you hibernate, the computer is 'locked in' (for lack of a better term) to that OS. You aren't hibernating the OS, you are hibernating the whole computer. When to resume from hibernation, you don't go through the BIOS and the POST time again.

share|improve this answer
    
I'm not talking about suspend to RAM, I mean hibernation to disk. I'll edit the question to be more specific. –  Ryan Thompson Sep 11 '09 at 8:48
6  
Seems wrong to me. When you're hibernating, the computer is shut down. When you start it on again, it goes through the BIOS and POST. It's only when the OS loader sees that it has been hibernating that it will load the file containing the memory state (hiberfil.sys for Windows) and restore the OS. –  Snark Sep 11 '09 at 8:48
    
No, it will cause problems with filesystem consistency. See my post above. –  Nathan Osman May 2 '10 at 3:52
    
@George: There will be problems with filesystem consistency, if you share any filesystems between both OSes. But you certainly can run a different OS that has its own set of partitions, contrary to this answer. –  Ben Voigt Jun 25 '12 at 15:05
add comment

I regularly hibernate my Windows XP and boot over USB into Ubuntu.
Works flawlessly.

There is a difference between 'Standby' mode and 'Hibernate' mode.
The OS state is completely flushed to the disk and your hardware is powered off.
If you power up the machine and boot into some other OS, it has no impact on the hibernated OS.
You can keep as many OS'es hibernated as you want.

As an example,
You could have multiple Ubuntu installations (say, one per USB flash drive),
And, hibernate each, unplug the drive, and boot into another one.
There is no edge here because there is no stacking/chaining effect.
The hibernated USB sticks in this examples are all independent of each other
(across a power-cycled machine).

One small downside of a hibernated "C:\" drive and booting into another OS is,
you would not be able to mount the hibernated boot partition in the new OS.
The partition is locked with hibernation.
It will be corrupted if edited in that state.

share|improve this answer
    
Actually you're wrong, in a good way! I tried hibernating Windows and booting into Ubuntu and mounting the windows filesystem, and it works, with no corruption when you resume Windows from hibernation! It surprised me. –  Ryan Thompson Sep 14 '09 at 7:48
    
IMHO the corruption people talk about is most likely related to the Linux NTFS driver being not fully compatible with all NTFS features. It's best to mount Read Only. –  Matt H Dec 13 '11 at 1:28
    
Ok, you would also want to read Is NTFS on Ubuntu stable? –  nik Dec 13 '11 at 14:16
    
nik is right -- do not mount the partition from the other OS, it is still mounted in the hibernated OS. You wouldn't mount the same partition in two virtual machines (using direct partition access) running at the same time, would you? –  Ben Voigt Jun 25 '12 at 14:59
add comment

There is nothing wrong with what you mentioned. Even if you mounted the hibernated filesystem, the contents of the hibernation are saved to a large file on the disc - as long as you don't touch this file, or any important system files (obviously), then nothing will happen.

If you change the contents of a partition from another OS after you turn the system off, the original partition will still boot with no problems. It's the same thing in hibernation.

Just be sure that when mounting/unmounting the partition, you don't damage any system files or drive header information (e.g. MBR, file journals) - although this point has nothing to do with hibernation, and more just a common warning we all need to know.

share|improve this answer
3  
Thought experiment: what if you have a document or file open in an app in Windows (eg you're editing a Word doc) then you hibernate and boot to the other OS. There's no active file lock any more so as far as Linux knows it can safely do anything with the file, so if you decide it's mis-filed and move it to a different directory Linux will let you. When you boot back to Windows what does Word do if its file has suddenly disappeared? Now think what would happen if this file was more vital than a Word doc? Read Only mounting is going to be an awful lot safer. –  GAThrawn Sep 11 '09 at 14:27
1  
This turns out to be the most accurate answer. You can, in fact mount and make modifications to the Windows C drive while Windows is hibernated, and it won't complain. I haven't tested this with Linux, but I suspect that it won't work. –  Ryan Thompson Sep 14 '09 at 8:21
    
@Ryan, you can but it is not 100% safe. NTFS might be broken far too easily. Another issue is that Linux and WIndows use NTFS slightly different so what is working with Windows might not work with Linux. These differences might end up in FS corruption, especially in such an edge case state of FS. –  vava Sep 14 '09 at 8:51
    
@GAThrawn - What does Word do? Try forcably editing a Word document under Windows and see what happens. Programs exist to remove file locks. @vava - As long as you are using a program/operating system which complies with the NTFS MFT and the Journal, it should be fine. –  Breakthrough Sep 14 '09 at 11:33
    
I know that it's not 100% safe, but the point is that if I accidentally mount the windows filesystem in linux after hibernating windows, the result is not instant and irrecoverable corruption. In other words, I would actually have to put in some effort if I wanted to shoot myself in the foot. –  Ryan Thompson Sep 14 '09 at 19:13
add comment

I always hibernate Windows before booting in anything else, Windows is just too slow to start from scratch. But it is dangerous to write to the partition of hibernated OS, because some of the FS tables are still in memory (well, in hibernation file but not in the FS), applications still have handles to some files and generally file system state is kind of unstable.

But you can mount that partition read-only, this way it will stay exactly the same as before hibernation and Windows won't notice a thing.

As for a suggestion about mounting it normally and just stay away from system files, it is not a good idea. Relocation of a file content might happen, MFT might be changed, access time attributes will be changed, all those things might seriously corrupt a file system. It is not so dangerous with FAT but it is really really dangerous with NTFS, as it is far more complicated and have far more state in the memory.

share|improve this answer
    
Are you sure that mounting read only is ok? My understanding is that with journaling filesystems, even a read-only mount will replay the journal and thus cause a change to the filesystem. On the other hand, the only Linux filesystem you can access from windows is ext2, which is non-jornaling, as is FAT, and Linux probably does a true read-only mount of NTFS, for historical reasons. So maybe it is safe. I any case, I'd like it if someone had concrete test results. –  Ryan Thompson Sep 11 '09 at 20:09
1  
No, when FS is mounted read-only nothing got changed on it at all. This is why it is called read-only :) There's no need for a journal as it ensures that state of FS alway correct but when state does not change, it is not necessary, so journal is not used. And it works for me for quite a while now, so there's your testing results :) –  vava Sep 12 '09 at 2:18
1  
"windows is too slow to start from scratch" Are you serious? I must be doing something wrong then, cause when my laptop hibernates, it adds around 2 minutes or more to my boot up time. –  thepaulpage Nov 11 '09 at 20:19
    
I was talking about XP and yes, it is slow as hell considering how much it time it takes from boot to working applications. Ubuntu 9.04 was running circles around it. Ubuntu 9.10 is much slower for some reason. –  vava Nov 12 '09 at 3:31
add comment

I ran into problems with hibernate and multi-booting. Situation: Ubuntu and WinxP Multboot but the data partition visible for both OS. I did some testing... back and forth... So I was editing a Wordfile with Word... Saved the file and closed Word. Hibernated... started Ubuntu... edited the same file with OpenOffice... hibernated.

Rebbooted to the hibernated WinXP. Word did NOT 'see' the changes... It simply loooked like another file...

I also did this testing the other way around... Second time file was corrupted... I could not open the file or delete the file Chkdsk 'solved' the problem but the file was lost... In another test Ubuntu did not even see the edited file.

SO when using hibernation and the same partitions (does NOT need to be the partition where the OS boots from...) ist is very dangerous... Files can and will corrupt in my tests and I can repeat it... BTW: In my tests I ALWAYS saved the file and closed the application (Word and OpenOffice) befre going into hibernate...!! I thought mounting the partition was the culprit but now I think the problem must be something about file-caching or whatever... Anyhow: Be careful with multi-OS-hibernation...!! Regards, ArnoR

share|improve this answer
add comment

DON'T DO IT!

On my computer (Vista/Ubuntu 10.04) this caused a huge fiasco.

I hibernated Windows and booted to Ubuntu. Then I accessed some files on the Windows partition (NTFS). When I switched back to Windows, I got the 'One or more of your disks has errors...' message.

Not fun.

share|improve this answer
add comment

I can confirm the loss of data issue with a shared NTFS partition. I dual-boot between Lucid Lynx Ubuntu and Windows 7. After hibernating Windows 7 and booting into Ubuntu, I proceeded to build three VirtualBox virtual machines (over the course of 7 days) and installed a variety of software packages into those machines. Upon restarting into Windows 7, the files disappeared. Gone. ntfsundelete and foremost were not able to find them.

So, I ran a series of tests to see if this was in fact what caused the loss of data. When shutting Windows 7 down, starting Ubuntu, writing some files, restarting back into Windows 7, the files are always retained. When hibernating Windows 7, restarting in Ubuntu, writing some files, restarting into Windows 7, the new files are gone.

I don't know about CHANGES written to a file, whether they are retained or lost, but new files and folders added to a shared NTFS partition are most likely going to be lost in this situation.

share|improve this answer
add comment

Don't do it (again!)

I hibernated my Vista/NTFS and booted up Lucid, worked 3 days on the shared ntfs partition, and started having files and directories disappearing or locked with nasty error messages (within lucid). When I booted back to windows it was a true mess, desktop gone havoc etc.. Hopefully chkdsk was able to fix most of it and I fished out from found.000 about 98% of what I had before.
So it's definitely not a good thing to do.
I sort of remember that this was not possible before: 'hibernated' ntfs partitions were not mountable in linux for some (apparently good) reason. I'd like to come back to this old behavior

share|improve this answer
add comment

DANGER! I can also confirm this is a dire issue for both FAT32 and NTFS volumes & only when Windows (I have windows 7) is hibernated. I think this is tied to caching and have considered setting the drive up for quick removal. That may fix it, but I haven't tried it yet because I really only want to set one partition up this way which Windows does not seem to support. Even my OSX ntfs driver supports per partition cache control, but not windows. Also, my OSX ntfs driver seems to recognize that the drive should not be mounted. Seems to be tied to this issue. Hope that helps.

share|improve this answer
    
Yes, it's related to caching, and no, "optimize for quick removal" won't help. That makes Windows write changes out immediately, but Windows will still assume (dangerously) that its read cache is 100% valid, and won't see changes other OSes have made to the disk. –  Ben Voigt Jun 25 '12 at 15:02
add comment

Just ran into an issue on a shared physical drive (FAT32) between Windows XP and Windows 7. I hibernated Windows XP, booted into Windows 7 for a few days, then went back to XP. Now I have a corrupt file system on the shared drive. Disk Checker is running, and it looks pretty bad. Mostly cross linked files though, but thousands of them.

share|improve this answer
1  
In other words... If you do hibernate to disk, DON'T use a shared drive. (or, if you use Linux, umount that drive before hibernating) –  Denilson Sá Feb 5 '11 at 2:40
add comment

Here is my experience. I am using a dual boot system with Windows and Kubuntu (11.04). Most of my files are on a Windows NTFS partition and I use primarily it from Linux. It's mounted using FUSE.

This is what happened:

  1. Hibernated Windows
  2. On the next boot, booted to Linux and used it for couple of weeks - without booting to Windows
  3. Booted back to Windows (because an online test only worked in Internet Explorer and nothing else, somehow ie4linux wasn't sufficient)

When Windows resumed, I noticed that all the files created in those two weeks were missing. I rebooted back to Linux to verify only to find files missing there too. I am guessing Windows restored the NTFS filesystem to the state when it was hibernated and restored it back to that point in time.

I tried tools like ntfsundelete and testdisk. Those missing files are not listed. Also, Linux mounts that drive in RW mode even when Windows had hibernated and not shutdown. I guess Linux warns or just mounts the drive in read-only mode, but that didn't happen here.

share|improve this answer
1  
There is a marking on the filesystem metadata whether it's unmounted properly or not... I also would think the correct behavior is for the Linux NTFS driver to check that flag. –  Ben Voigt Jun 25 '12 at 15:04
add comment

I had the following highly destructive experience with dual-booting Windows (Vista) and Ubuntu (9, 10, 11). I am not a technical user, though I have long experience using and configuring Windows and DOS. I installed Ubuntu via a live CD on a Win Vista machine. This proceded flawlessly and I had the dual boot up and running in no time. Seeing as there were no warnings attached to the Ubuntu installation, I (naively) assumed that I could hibernate (saving to disk, not suspending) both systems and switch freely between them. This had the following results:

1) I made the mistake of editing a text-file in Ubuntu that I had forgotten was open in Windows. Afterwards the file was inaccessible to either operating system. It could not even be deleted. Chkdsk finally deleted it, but my data were lost.

2) I also tried two other file operations from Ubuntu directly into the Win partition: Generating a pdf-file from OpenOffice, and creating a directory/folder on the Win desktop. Both were inaccessible from Windows (though they could be seen in Win explorer). Luckily they could be deleted from Ubuntu, though chkdsk had to be run afterward to delte then completely from Windows.

3) A large OpenOffice Writer file (saved as *.doc), which was edited first in one, then in the other operating system several times (it was not open in the other system when I edited it), suddenly ballooned in size from about 2 MB to 7 MB, making it nearly impossible to load and save. When I saved the file as an *.odt document its size was greatly reduced but save/load times were no faster. When I unzipped the file, its "contents" section turned out to be more than 22 MB. When I accessed this with a text editor, it turned out that every single word and space in the document was separately formatted in and out of the same style! I finally resolved the problem by comparing the giant version with an earlier version of the same file, using the old version as the basis for the comparison, and then accepting all changes and saving.

4) At this point I upgraded from Ubuntu 10 to Ubuntu 11 and discovered that the 11 system used the new Unity interface exclusively, which was completely unacceptable for my purposes. When I figured out how to install Gnome on Ubuntu 11, it turned out Gnome 3 was far inferior to Gnome 2. I therefore decided to uninstall Ubuntu completely and make a fresh installation of Karmic Koala, which uses Gnome 2 without any trace of the new Unity system. This turned out to be complicated, but after finding the exact same instructions repeated in several manuals online, I proceded. Everything went fine until I ran EasyBCD 2.1.2 (from windows), which would allow me to reboot directly to Windows after Ubuntu's Grub booter had been removed. On rebooting, I found that my MBR was fatally damaged and the machine did not recognize any bootable hard drives. I needed to pay a technician to restore the MBR.

5) Now I could boot to Vista again and I was getting ready to reinstall Ubuntu, when I discovered that a number of files started disappearing from my system at random. Obviously the file system was still corrupted. Only a complete reinstall of Windows solved the problem, and I am now considering very carefully what I should do to avoid similar problems in the future, before installing Karmic Koala. I hope my problems are related to the hibernation issue, but to be sure, I am considering creating a separate "transfer" NTFS partition, where I can put files from one operating system before accessing them from the other. Impractical, but it ought to be safe. I hope.

share|improve this answer
add comment

I can also confirm that share some non-system partition between two different O/S in hibernate state makes file system corruption and loose of data.

Scenario: I have 3 partitions NTFS: 1. Windows XP 2. Windows 7 3. Data ( I have to still use XP for old apps which don't work well in compatbility mode).

Example: Boot from partition 1 (XP) and run Thunderbird which store files on 3. Then hibernate (OS dump RAM to hibernate file and shutdown PC). Boot from partition 2 (7) and run Thunderbird which store files on 3. Here the problem begins with access files etc. sometimes with or without chkdsk. Back to boot from partition 1 and files fixed by OS_2_7 are again corrupted, even worst some open files before hibernation (ex. Firefox) are corrupted now.

So yes. Hibernate two O/S no matter they use system/non-system partition will make data corruption. Why ? I suppose the root cause is file LOCK and MFT. After wake up from hibernation O/S doesn't refresh MFT so still suppose to find files in old sectors, so any file which changed his size/place will be corrupted.

share|improve this answer
    
Well, what files became corrupted? Just those belonging to Thunderbird or several unrelated files? It can make (some) sense that if Thunderbird is run from the same location in partition 3 then there are two different data sets in two different systems. One will try to force the other. –  Doktoro Reichard Sep 29 '13 at 0:25
add comment

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.