10

I've got both Windows 7 and Ubuntu (finally) installed on my laptop.

For the sake of comfort, I usually hibernate Windows instead of shutting it down. And I think when using Ubuntu regularly, there will be times when I do that to quickly switch from Windows to Ubuntu to check or do something quickly and then want to continue my work on Windows.

1) Are there any problems with hibernating both Windows and Ubuntu at the same time?

I should probably also mention that I created an extra partition which I use to access from both Windows and Ubuntu. I would like to put my www directory of my test web servers on that drive, so that I can work on that stuff both from Windows and from Ubuntu.

2) So - is this a good idea and what do I have to be careful with?

EDIT: One important sidenote I forgot: I want to share a Mozilla Thunderbird profile directory on a shared drive. Does that change anything?

3

2 Answers 2

11

I've never tried it with Windows, but I think it should work. There's just one point you have to be very careful of: always unmount the shared partition(s) before hibernating.

More precisely, you need a reader-writer lock on each shared partition. That is, at any given time you must either:

  • have one OS (live or hibernating) with write access to the partition, and no other OS with read access;
  • or have any number of OSes with read access, and none with write access.

Again, a hibernating OS with the partition mounted counts as an access. This is because when an OS hibernates, it saves some assumptions about the partition (i.e. some form of cache)¹. If the assumptions have become wrong when you resume, massive filesystem corruption is likely to occur.

¹ I think current hibernation systems under Linux don't hibernate any data cache, but there is a little metadata that's saved as part of the kernel state. It's possible that you may be lucky enough that this metadata doesn't change short of a filesystem resize or defragmentation, but I wouldn't risk it.

4
  • Could you comment on my edit, please? The only thing that keeps me from accepting an answer...
    – Franz
    Nov 19, 2010 at 13:52
  • @Franz: Seems to me that this answer directly addresses your edit: If the shared partition is mounted in both operating systems at the same time, you run a significant risk of that partition (including your Thunderbird profile directory) being corrupted if one OS alters its contents while the other (even if hibernating) has cached data or metadata from that partition. Nov 19, 2010 at 14:01
  • Which would mean I should rather not, right?
    – Franz
    Nov 19, 2010 at 14:52
  • @Franz: As I indicate in my footnote, I don't think you could leave the partition mounted before hibernating, but I don't know for sure about an NTFS partition. Even if it turns out leaving the partition mounted is safe, I think you can't run two copies of Thunderbird at the same time on the same profile, so you'd have to close Thunderbird before hibernating. Nov 19, 2010 at 19:52
9

I use both Windows and Debian GNU/Linux on my netbook. I hibernate them both and choose one on awakening and have had no problems whatsoever. I also have a shared data partition similar to what you describe. I use NTFS (which is fully supported by recent Linux releases) and have had no problems.

Ubuntu (and Linux in general) hibernate to a swap partition. That is, the contents of RAM are saved to this extra partition. Windows saves to a swap area in its own partition (by default). The two images are in totally different places and cannot interfere with each other.

6
  • Mirrors my general observations on my Vista/Ubuntu desktop.
    – Tarka
    Nov 15, 2010 at 21:52
  • Could you comment on my edit, please? The only thing that keeps me from accepting an answer...
    – Franz
    Nov 19, 2010 at 13:51
  • I have no experience with sharing Mozilla Thunderbird profiles. May I suggest that this is an entirely separate question which you should ask separately, with the 'mozilla-thunderbird' tag and a subject like "Can I share the same Thunderbird profile between two operating systems?"
    – CarlF
    Nov 19, 2010 at 16:55
  • It's not clear from your answer that you leave the shared partition mounted when you hibernate. I know from experience this wouldn't work with an ext3 partition (shared between Linux and Linux); I would be surprised if it worked with another filesystem, but I don't actually know. Nov 19, 2010 at 19:49
  • @Gilles, it's an NTFS partition. It's never dismounted, but both Windows and Linux are smart enough to flush disk buffers when hibernating. Note that this does NOT work on the Windows boot partition, even though both are NTFS.
    – CarlF
    Nov 30, 2010 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .