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.

I set up a dual boot before, but I've never thought about how or if putting a laptop to sleep or hibernate will affect grub or the OSes. For example, if I dual boot windows 7 and ubuntu, then use windows and put it to either sleep or hibernate, will something go horribly wrong if I select ubuntu at the grub menu?

share|improve this question

2 Answers 2

No, the ram state is stored into the swap file or swap partition.

Since you use different swap spaces for ubuntu and windows 7, you should be able to..

  1. Hibernate on windows
  2. Boot into linux and then hibernate
  3. Boot into windows and resume session.. Hibernate again.
  4. Boot into linux and resume linux session.

Now, if you use two operating systems that are sharing the same swap space.. I have no idea what will happen. I dual boot two linux distros that use the same swap partition, so I have to careful of this. (well, I would be if I ever used hibernate =p)

share|improve this answer

From a similar question on Super User:

Generally speaking, you can hibernate one operating system and boot the other. Each system's state is saved in its own swap space, so you must not share the swap space between the two operating systems.

There's one thing you must pay attention to: while a partition is mounted in a hibernated operating system, you must not access it from other operating systems. With most filesystems, this is likely to destroy your data. (This doesn't apply to network filesystems mounted from another machine, these are designed to be mounted from multiple places at once.) Exception: if the shared partition is NTFS and it's not the Windows boot partition, it's safe to share at the filesystem level (but you'd better not keep a file open in a hibernated application, so it's better to unmount the shared partition before hibernating anyway).

share|improve this answer
    
NTFS is no exception to that rule. It is all too easy to mount your windows partition from within Ubuntu, and if it is hibernated, this will cause corruption. –  psusi Aug 3 '11 at 2:16

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.