How should I set up my dual-boot so that I can hibernate the secondary OS?

10

7

So, my previous setup was a triple-boot of Windows 7, wubi-integrated ubuntu, and then fedora on the last partition using LVM. I have tired of not being able to access my Windows files from ubuntu (wubi ubuntu is basically a virtual machine) and my fedora partition was taking up way too much space, so I deleted my not-much-used fedora. Now, I'm back in only Windows 7 (64-bit) and am going to re-create my triple boot.

I had been using the Windows bootmanager with an entry (added with EasyBCD because I'm lazy) for the GRUB on the Fedora partition. However, using the Windows bootloader as a primary one prevented me from hibernating Windows and then booting into Linux. So I have to use GRUB now.

Basically, my question (abbreviated) is:

How can I set up a main GRUB to boot into the following scheme?

  1. Ubuntu
  2. Fedora
  3. The Windows boot loader

I want to keep as much hibernate functionality with as many OSes as possible.

edit: I made a fundamental misunderstanding: GRUB (and grub2, and burg), unlike the Windows bootloader, does not automatically resume hibernated systems! Just use any OS's (doesn't need to be a seperate) GRUB, GRUB2, or BURG as the primary bootloader to hibernate/resume or hibernate/resume Windows by chainloading its bootloader. My whole question is moot.

WindowsEscapist

Posted 2012-05-01T15:10:34.743

Reputation: 1 828

Just a pre-emptive warning that since OS X on hardware not Apple-branded is outside the terms of its EULA ("hackintosh") questions asked about it here will probably be closed. – Bob – 2012-05-01T15:17:43.310

alright, thank you (that was irrelevant anyways) (I'm new to superuser) – WindowsEscapist – 2012-05-01T15:25:20.263

Answers

14

If you want to hibernate and use a different OS while Windows is hibernated you must not put the Windows bootloader first, contrary to what @snayob says.

If the Windows bootloader is first, the very first thing it does before showing the menu is check for a hibernated OS. If a hibernated OS is found, it will boot into it automatically and will not show you a menu to choose boot options from. If you force the menu (i.e. F8), the hibernation data will be deleted.

Now if GRUB is the MBR boot menu and is configured to chainload BOOTMGR or boot into Linux, you can hibernate Windows and boot into Linux - but if you mount the NTFS partition, most likely your hibernation will be lost (detected as corrupted). Basically, if you hibernate a machine, you must not touch any volumes that were mounted on that machine (i.e. any FAT32 or NTFS partitions assigned a drive letter in the hibernated OS).

Ridiculously important note: In the event that you mount (say, in Linux) a Windows partition while Windows is hibernated and you are unlucky enough that when you're done with Linux and attempt to reboot into Windows, Windows does resume from hibernation (instead of erroring out, throwing away hibernation data and attempting a normal boot), you will most likely suffer catastrophic data loss to all Windows partitions as all filesystem-related structures will be out-of-sync between what Windows has loaded in the memory and what's actually written on the disk.

Other than that, there's no problem. Just install Windows, Ubuntu, and Fedora. Make sure the latter do not automatically mount Windows' drives on startup, ensure GRUB is the main bootloader, and you should be able to do what you want.

Mahmoud Al-Qudsi

Posted 2012-05-01T15:10:34.743

Reputation: 3 274

-4

You have to put Windows boot manager back in control of the booting.

The reason is that every StartUp Repair of Windows will write a Windows MBR (bad things happen and repairs have to be done).

Repairing the booting of a Linux based OS does not necessarily write to MBR (must be specified during repair as every OS will take over the MBR by default !)

You can always do a StartUp Repair and fix Windows 7 booting (and hibernation).

Wubi is dependend on Windows 7 bootmanager by default. Wubi is not a virtual machine based only disk is virtual. (Can be compared with Windows VHD installations)

Always install Linux based systems boot loader (GRUB) to partition (NOT MBR !) and you will not have problems with dual/multi booting.

Try Visual BCD Editor for creating boot sector loaders for Linux based OS's. Use the boot loader first stage images as "boot sector file":

GRUB legacy - stage1 from /boot/grub (older versions of Fedora, Ubuntu)

GRUB 2 - boot.img from /boot/grub (newer versions Fedora, Ubuntu)

Hibernation depends on a boot manager to relaunch OS. So whatever boot manager is in control - its OS (OS's) wiil be able to properly hibernate and be relaunched.

snayob

Posted 2012-05-01T15:10:34.743

Reputation: 4 044

-1 You do not need to use Windows boot manager on multi-boot machines. – Harry Johnston – 2012-05-02T02:38:54.323

I would -1, but I haven't the rank. Your answer is near-incomprehensible, chock-full of errors, and unhelpful. What do you mean by "You have to put Windows boot manager back in control of the booting"? I clearly stated that I am starting again from scratch, from a Windows install. You don't answer my question at all. I know how to dual, triple, or quad-boot without hibernation, but I would like to have it (and I had been using EasyBCD to use the Windows boot manager with entries for chain-loading Linux already, as I stated in the question). – WindowsEscapist – 2012-05-05T20:24:23.053

You have to take special measures in Linux descendants so they do not map automatically Windows partitions. When you install a new Linux it mounts all Windows partitions by default. Hibernating multiple OSs is stupid and dangerous. Everybody is free to ruin his system. – snayob – 2012-10-16T15:09:45.030

1Hey @snayob, coming back more experienced a year later I can now tell you that I can now hibernate and switch between Fedora, Ubuntu, Windows 8, and Windows 7 at will while all the others are hibernated. I've been doing this for months, and have had no problems yet! – WindowsEscapist – 2012-10-31T01:59:28.310

No problem - we will be here to help if problems come to surface. What is the BIG gain when hibernating multiple systems ? You boot how many secends faster ? What is the price paid ? – snayob – 2012-11-11T08:41:12.517

1@Snayob No price is paid, I boot and shut down about 10s faster, and have experienced no problems whatsoever. – WindowsEscapist – 2013-02-04T15:39:21.540