Wednesday, December 31, 2008

Linux and Vista Hibernation problems

Are you experiencing problems hibernating Windows Vista when you have linux installed in a dual boot setting? Does Vista log you out and show you the login/welcome screen when you try to hibernate your computer? The following may be the cause of your problem.

Vista needs the Windows partition to be marked as the active partition in order to hibernate successfully. To do this, you can use cfdisk utility available on most linux distributions. If you want to use Vista to do this, see the update at the end of the post.

For Ubuntu,
sudo apt-get install cfdisk
My openSUSE already had this installed by default. So fire up the terminal/konsole and sudo/su to cfdisk.


Be very careful with this. Do not make changes you do not understand as if you corrupt the partition table, you might lose all your data, along with the OSs. Be sure to backup your important files.


Look at the partitions and change the 'Boot' flag from the linux partition to the Windows partition. Then select 'Write' to change the partition table. cfdisk may give a message that re-reading the partition table failed. This is normal so don't worry about this.

Reboot to Vista and test hibernation.

Cheers!

Update: Much simpler and easier method using Vista, thanks to Marco:
  1. Boot to Vista
  2. Go to Start menu, right click Computer and select Manage to get the Computer Management window.
  3. Select Disk Management under the Storage category. Your partitions will be shown at the right.
  4. Right click on your Vista partition and choose "Mark Partition as Active". Your Vista partition will most probably be an NTFS partition and will be labelled 'C:'
It's that simple! Now why can't we have something like this in YaST2?

A word of caution: If you have grub setup to boot from the boot partition, this method will cause grub to be skipped while booting and Vista will get booted directly. If this happens to you, use a live cd and restore the boot flags for partitions. Set grub to boot from the master boot record to avoid this from happening.

3 comments:

Marco said...

hi, very useful post.
By the way, I took another way to make active the Vista partition.
I booted Vista and from the Disk Management (right-click on Computer then Manage) i right-clicked on the vista partition an i choosed "Mark Partition as Active".
I think it's simpler this way :)

Xor said...

Thanks for the simpler way Marco! Post updated!

Anonymous said...

Thank you very much!! I had tried deleting the hibernation file and then using "powercfg -h on" without success; but setting the partition as active solved it =D