0

I have Ubuntu 12.10 and Windows 7 Home Basic in one machine. After I put my Windows 7 to hibernate and then when I press the power button, instead of loading the BOOT OPTIONS or GRUB screen it directly boots Windows 7. I've read in some forum that pressing ESC after you press the power button, but even it couldn't help me as the laptop started making a loud noise. Please help me on how should I boot OS while hibernate W7 and again RESUME W7 after shutting down Ubuntu. Thanks in anticipation.

user2607744
  • 171
  • 1
  • 1
  • 7
  • 2
    Are you sure you're hibernating, not sleep? – Alaa Ali Aug 07 '13 at 12:33
  • Yup.. i hibernate my W7...den i press the power button, in the intention of booting Ubuntu; but to no avail. The only way i have to boot Ubuntu is SHUT DOWN W7, and then start the machine, and eventually choose the booting option from the Grub screen.(Hope you're getting my point??) – user2607744 Aug 08 '13 at 17:13
  • Can ANYBODY answer me? – user2607744 Aug 11 '13 at 06:44
  • @Alaa .. pls help mahn!!!! – user2607744 Aug 13 '13 at 14:17
  • How is your Ubuntu installed? Using Wubi (installed inside Windows) or on a separate partition? – Alaa Ali Aug 13 '13 at 14:56
  • @Alaa I have installed Ubuntu in the same hard disk as Windows 7 Home Basic's but different partition. My Windows reside in C parition and Ubuntu is H paritition. – user2607744 Aug 13 '13 at 15:12
  • H partition? You problem is that you installed Ubuntu inside Windows using Wubi. I'll post an answer explaining in a bit. – Alaa Ali Aug 13 '13 at 18:57
  • Wait. I just read your comment on amc's answer. How is it that you installed Ubuntu using a bootable USB, but you say "it's installed in the H: partition"? In your Windows right now, do you see an H: partition with an "Ubuntu" folder inside it? – Alaa Ali Aug 13 '13 at 22:34
  • @Alaa ..i know I am confusing things right now!! Sorry ...i'l give u the picture- I installed the Ubuntu by, first copying the .iso file in by USB and making the USB bootable with the help of instructions given by Ubuntu community(I mean when I was installing it, I kept on getting the instructions). OK! And then, I installed an .exe file which let me install Ubuntu from Windows itself, without the need of, you know, booting the entire the system. – user2607744 Aug 14 '13 at 14:24
  • @Alaa ..got the picture!!???? – user2607744 Aug 14 '13 at 14:24
  • Answer all these questions: what was the name of that .exe file? wubi.exe? In your Windows right now, do you see an H: partition with an "Ubuntu" folder inside it? – Alaa Ali Aug 14 '13 at 14:38
  • @Alaa
    1. Yup, it was wubi.exe.. thanks for reminding me .
    2. Yup, I have a partition named H, with an Ubuntu folder in it...comprising of Ubuntu OS files.
    – user2607744 Aug 14 '13 at 15:01

3 Answers3

0

First, it's important to understand the technical reasons why what you are are hoping to achieve is likely infeasible. When you hibernate Windows the computer writes everything in memory to the harddrive and powers off the computer. When hibernating, any changes to the disk could corrupt the install and render your computer unusable. Therefore, hibernation is specifically designed NOT to allow you switch between OSes while one is hibernating.

That being said, see https://superuser.com/questions/46299/is-it-possible-to-enable-hibernation-when-dual-booting-windows

Depending on your setup you should be able to use your BIOS boot menu to switch between OSes when hibernating.

This relies on you having installed each OS on different physical drives.

amc
  • 7,142
  • Why is it infeasible? It's perfectly normal to do it. Windows "writes everything in the memory to the harddisk" to a file called hiberfil.sys. Starting up a computer after a hibernate should start normally, and load the bootloader, giving you the OS options (even if both are installed on the same physical hard disk on different partitions). I am dual booting, and as far as I remember, I can hibernate Windows and boot Ubuntu, without having to change anything. – Alaa Ali Aug 13 '13 at 14:51
  • thanks for the reply...actually my friend has tried and succeeded in doing it. I installed Ubuntu 12.10 in the following way:
    1. Downloaded Ubuntu 12.10 in .iso format.
    2. Made a bootable USB with the .iso file in it(with unetbootin software)
    3. Installed Ubuntu with USB, also, I downloaded an application which helped installed Ubuntu from Windows without restarting Windows 7.
    4. Installed properly...with virtually no glitches...

    Can you specify an alternate way to get Grub Screen?? I know the risks..but just wanna know it, and wanna try it.

    – user2607744 Aug 13 '13 at 14:57
  • @Alaa...can u suggest an alternate way ?? – user2607744 Aug 13 '13 at 14:57
  • Depends on how you use your system -- it's potentially dangerous to access anything on the windows drive while using Ubuntu. I know that when I dual boot I still want to access and modify the windows file system. – amc Aug 13 '13 at 15:46
  • @amc yes, I completely agree, it is dangerous, that's why one can't mount a hibernated Windows partition (we get an error). However, the problem with the person that asked the question is that he can't even boot into Ubuntu when he hibernates Windows; he doesn't even get a choice of OS. – Alaa Ali Aug 13 '13 at 18:39
0

Answer:

Because you have Ubuntu installed using Wubi, unfortunately, you won't be able to choose which OS you want to boot if Windows is hibernated.

Explanation:

From the comments, it seems that you have Ubuntu installed using Wubi, which means that you installed Ubuntu inside Windows. This is because in the comments, you said "Ubuntu is installed on partition H:", which probably means that you can access this H: partition from your Windows OS and see a folder called "Ubuntu" inside it, correct? If yes, read on:

When you restart your computer, it boots BOOTMGR by default, which is the Windows bootloader, and gives you the OS choice (Windows or Ubuntu). If you select Ubuntu, you go into GRUB. All good so far. However, the first thing BOOTMGR does (before giving you the OS choice) is it first checks if there is a hibernated OS. When it finds that Windows is hibernated, it directly boots into it, without giving you the options. This is what is happening on your machine. GRUB, on the other hand, does not do this.

How would you overcome this? By making GRUB the default bootloader (with Ubuntu and Windows as OS choices), not BOOTMGR. This, however, is in the case if Ubuntu is installed on a separate partition (a partition formatted in another format, ext4, that is not accessible through Windows). But because your Ubuntu is installed through Wubi, meaning that it's on the H: partition, meaning that it's on a Windows partition, this partition is part of the hibernated Windows! Get it =)? So we can't install GRUB as the default bootloader and ask it to boot Ubuntu from the hibernated partition, because then it will (I think) attempt to destroy the "hibernated data" and basically shutdown your Windows (and you lose all your unsaved data when you hibernated), then attempt to boot into Ubuntu. Get it now?

So in the end, unfortunately, I don't think it's feasible. Your solution would be to uninstall Ubuntu/Wubi, and install Ubuntu from scratch on a separate partition. This solution will uninstall Ubuntu/Wubi and will delete everything in your Ubuntu, so make sure you backup the files you need.

Another possible solution is to convert (migrate) your Wubi Ubuntu into a full, normal Ubuntu installation (put in on a separate partition). This way, it will copy over all your content, and you should find all your files the way they were (**although it is always advisable to backup your files whenever playing around with OSs). The steps to do this solution are detailed here: How to convert Wubi install into regular install? Here is a brief description of what you'll be doing:

  1. Boot into your Wubi Ubuntu.
  2. Using gparted, create an empty partition big enough to house your Wubi Ubuntu (just make a partition as big as your H: partition, or as big as the "Ubuntu" folder). Choose ext4 as the filesystem type for the new partition.
  3. Download the script from that question, and run sudo bash wubi-move.sh /dev/sdaX, where sdaX is your new partition you created in step 1 ("X" is a number, e.g. sda6. You can see the number of that new partition in gparted next to the partition).

Again, this is a brief description. Visit the question I linked and read the whole thing.

Having said all of this, my advised solution would be to:

  1. Backup everything you want from your Ubuntu.
  2. Completely remove Ubuntu Wubi (How do I uninstall Wubi)
  3. Install Ubuntu from scratch.

If your H partition was only meant for Ubuntu, then you can use that whole partition to install the new Ubuntu.

Alaa Ali
  • 31,535
  • ...thanks a lot for such an elaborate explanation!! your last sentence said that I can uninstall Wubi..right??? so, if i do that will I lose all my data in ubuntu.. i.e all my softwares and applications like NetBeans, OpenJdk, etc..??? or else, should I RE-INSTALL Ubuntu ...??? – user2607744 Aug 14 '13 at 15:46
  • There is a way to convert your Wubi to a full installation. In my opinion though, you should backup your files, completely remove and uninstall Wubi (deleting everything), and reinstall Ubuntu. This way, it's "cleaner", you know, because you never know what may go wrong, or if it's going to be stable. I've edited my answer to include more info on both solutions. – Alaa Ali Aug 14 '13 at 16:32
  • thanks a lot bro!!!!!!!!!!!!!!!!!! Will boot Ubuntu n den remove the WUBI crap from it. :) – user2607744 Aug 14 '13 at 17:30
0

I am answering the part of the question that deals with the issue "I can't even resume Windows". I was also having this problem... in a system with dual-boot installation of Windows 7 and Ubuntu (actually Linux Mint 17 64-bit!), I have a modern system (Gigabyte motherboard with UEFI bios) and can selectively boot the Windows boot manager, the GRUB loader, etc.

When I hibernate my W7 session, no matter what I do, I cannot resume it. I always get

"Your computer cannot come out of hibernation"

and the error shown is code 0xC000009a. It doesn't matter if I choose the Windows boot loader from the BIOS boot menu, or use GRUB and select the Windows boot option; the end result is the same: I am forced to destroy the information from the suspended (hibernated) W7 session and boot "fresh" into Windows.

Researching this a bit, especially by searching for that error message and the specific code, I found this solution, credit where it is due: http://www.sevenforums.com/general-discussion/307622-serious-error-0xc000009a.html and http://answers.microsoft.com/en-us/windows/forum/windows_7-system/windows-boot-manager-your-computer-cant-come-out/a3170a6f-2962-45ac-8005-bde7abb35831

Apparently, the error code indicates an error relating to registry information in Windows. But, it appears there also may be some problem with the hiberfil.sys file that Windows uses to store the hibernated information.

SO, the fixes suggested by both of these websites is as follows:

  • Find your Start -> All Programs -> Accessories -> Command Prompt item on the menu, right click it, and select Run As Administrator. Then, type the following command:

    powercfg -h off

  • Reboot your system (do NOT hibernate)...

  • when you are back in Windows again, repeat the running of Command Prompt with Administrator privilege as above (kinda like "sudo"), then type:

    powercfg -h on

  • test your fix by hibernating W7, then waking the machine up and (if you enter the GRUB loader due to your setup) choose to boot Windows 7. It should say "Resuming Windows"

This sequence of steps apparently clears up any corrupted hiberfil.sys AND any Registry "misapprehensions" about how your hibernation is set up. I don't have more technical detail as to why it works, but it does! I can now hibernate freely, and boot back into Windows 7 after hibernating, even using GRUB as the boot manager (but of course, selecting Windows boot).

I changed my GRUB default to boot Windows after the timeout, so that restoring my hibernated sessions of W7 would be the most convenient for me. I use W7 more than Linux, but with the dual boot setup, I have the best of both worlds!

Thanks to every person out there who has brought us this wonderful free software called GNU/Linux!

JoGusto
  • 101