Bug Description

My computer came with Windows 7 installed on it. I wanted to try Ubuntu, so I installed it alongside Windows 7 and everything was fine. I needed more space on my Windows 7 partition, so I deleted the Ubuntu partition from the hard drive. When I went to restart I got a blank screen. I reinstalled Ubuntu allongside Windows 7 and was able to restart and boot Windows. The next day I got the same blank screen, so I reinstalled Ubuntu over Ubuntu, leaving the Windows 7 partition alone. After that, when I try to boot Windows 7 it keeps sending me back to the select an OS page. I get an error that says:

The NTFS partition is hibernated. Please resume and shutdown Windows
properly, or mount the volume read-only with the 'ro' mount option, or
mount the volume read-write with the 'remove_hiberfile' mount option.
For example type on the command line:

mount -t ntfs-3g -o remove_hiberfile /dev/sda3 /media/OS

whenever I try to access the Windows OS portion of the hard drive.

When I try the command it does not work and I get a message saying that "only root can do that"

I can not resume Windows to shut it down properly though, because I must first unhibernate Windows.

I believe this may be a bug.

This is what the bootinfoscript reports, showing that Grub has overwritten the bootsector, which prevents Windows from booting:
sda2: __________________________________________________________________________

File system: ntfs
Boot sector type: Grub2 (v1.99)
Boot sector info: Grub2 (v1.99) is installed in the boot sector of sda2 and looks at sector 1456312560 of the same hard drive for core.img. core.img is at this location and looks for (,msdos6)/boot/grub on this drive. No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Boot/BCD

You seem to be conflating two unrelated errors. One involving mounting your windows partition from within Ubuntu, and one with booting windows. If you want to clear the hibernation file and mount the partition from Ubuntu, you need to prefix the command with sudo to get super user permissions. See http://wiki.ubuntu.com/RootSudo for more information.

When you try to boot windows, is there any error message from grub? Please run this script and add the results to this report:

I didn't mean for the two errors to sound unrelated, but I believe that I can not boot Windows because it is in hibernation. That is the problem I am trying to fix, and what I believe the bug is. I came about this possibility because: 1) I left windows on overnight and it would have gone into hibernation, and 2) When trying to access the Windows partition I got the above error stating that Windows was in hibernation. The fact that I could not mount Windows was just an observation. There is no error message from grub. I will try the script now and get back to you.

Extract the script from the archive, and if you extracted it to your Downloads directory, then open a terminal and:

cd Downloads
sudo ./bootinfoscript

Mounting means opening the filesystem on the disk and attaching it somewhere within the Unix filesystem hierarchy so you can access the files. ntfs-3g normally refuses to mount an NTFS partition if it detects a windows hibernation file, since modifying the filesystem while windows is hibernated would cause corruption when windows resumes. The option you are trying to pass instructs ntfs-3g to go ahead and delete the hibernation file ( preventing windows from resuming ), and proceed.

File system: ntfs
Boot sector type: Grub2 (v1.99)
Boot sector info: Grub2 (v1.99) is installed in the boot sector of sda2 and looks at sector 1456312560 of the same hard drive for core.img. core.img is at this location and looks for (,msdos6)/boot/grub on this drive. No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Boot/BCD

You appear to have mistakenly installed grub to the boot sector of the NTFS partition. You will need to use the windows tools ( FIXBOOT command in the recovery console iirc ) to repair the boot sector, replacing grub with the windows boot loader.

> You appear to have mistakenly installed grub to the boot sector of the
> NTFS partition. You will need to use the windows tools ( FIXBOOT
> command in the recovery console iirc ) to repair the boot sector,
> replacing grub with the windows boot loader.
>
>
> ** Changed in: grub2 (Ubuntu)
> Status: Incomplete => Invalid
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1079482
>
> Title:
> Windows 7 Not Booting
>
> Status in “grub2” package in Ubuntu:
> Invalid
>
> Bug description:
> My computer came with Windows 7 installed on it. I wanted to try
> Ubuntu, so I installed it alongside Windows 7 and everything was fine.
> I needed more space on my Windows 7 partition, so I deleted the Ubuntu
> partition from the hard drive. When I went to restart I got a blank
> screen. I reinstalled Ubuntu allongside Windows 7 and was able to
> restart and boot Windows. The next day I got the same blank screen, so
> I reinstalled Ubuntu over Ubuntu, leaving the Windows 7 partition
> alone. After that, when I try to boot Windows 7 it keeps sending me
> back to the select an OS page. I get an error that says:
>
> The NTFS partition is hibernated. Please resume and shutdown Windows
> properly, or mount the volume read-only with the 'ro' mount option, or
> mount the volume read-write with the 'remove_hiberfile' mount option.
> For example type on the command line:
>
> mount -t ntfs-3g -o remove_hiberfile /dev/sda3 /media/OS
>
> whenever I try to access the Windows OS portion of the hard drive.
>
> When I try the command it does not work and I get a message saying
> that "only root can do that"
>
> I can not resume Windows to shut it down properly though, because I
> must first unhibernate Windows.
>
> I believe this mat be a bug.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1079482/+subscriptions

> You need to use the FIXBOOT command iirc, not FIXMBR, to repair the
> windows boot sector.
>
>
> ** Changed in: grub2 (Ubuntu)
> Status: Incomplete => Invalid
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1079482
>
> Title:
> Windows 7 Not Booting
>
> Status in “grub2” package in Ubuntu:
> Invalid
>
> Bug description:
> My computer came with Windows 7 installed on it. I wanted to try
> Ubuntu, so I installed it alongside Windows 7 and everything was fine.
> I needed more space on my Windows 7 partition, so I deleted the Ubuntu
> partition from the hard drive. When I went to restart I got a blank
> screen. I reinstalled Ubuntu allongside Windows 7 and was able to
> restart and boot Windows. The next day I got the same blank screen, so
> I reinstalled Ubuntu over Ubuntu, leaving the Windows 7 partition
> alone. After that, when I try to boot Windows 7 it keeps sending me
> back to the select an OS page. I get an error that says:
>
> The NTFS partition is hibernated. Please resume and shutdown Windows
> properly, or mount the volume read-only with the 'ro' mount option, or
> mount the volume read-write with the 'remove_hiberfile' mount option.
> For example type on the command line:
>
> mount -t ntfs-3g -o remove_hiberfile /dev/sda3 /media/OS
>
> whenever I try to access the Windows OS portion of the hard drive.
>
> When I try the command it does not work and I get a message saying
> that "only root can do that"
>
> I can not resume Windows to shut it down properly though, because I
> must first unhibernate Windows.
>
> I believe this may be a bug.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1079482/+subscriptions

* Rearrange postinst install_devices logic so that preparatory code is run
only once and the while loop only encloses actual asking of questions,
and so that the question being asked is always marked for redisplay when
going round the while loop again (LP: #580408).
* Only offer partitions containing /, /boot, or /boot/grub for
grub-install; installing to other partitions may have harmful effects
such as making Windows unbootable, and installing GRUB to every single
partition is likely to result in confusion anyway (LP: #576724).
-- Colin Watson <email address hidden> Thu, 01 Jul 2010 18:26:37 +0100

Grub2 may have been fixed to prevent installing on any windows partition, but it is still installed on my windows partition. I didn't select to install grub on the windows partition, I chose to install Ubuntu alongside windows. It did not specify where it would install the grub, and there was no option to chose where it installed. I have tried using the fixboot command from my windows recovery disc, but there was nothing then (as stated in an above post).Would the instructions from https://help.ubuntu.com/community/BootSectorFix , using the TestDisk steps be able to fix my windows boot problem?

I have tried using the FIXMBR command in the windows recovery disc but, as described in an above post, it did not work. Could you point me to a source that can instruct on how to properly use this command instead of arguing about how a post was unrelated? I did happen to find one of the links helpful for suggesting another way to fix the MBR. A month has gone by and I am still no closer to fixing the problem. I am grateful for any help I can get.

Is the problem that the ubuntu grub can't boot windows from hibernation mode? Would replacing the origional windows mbr work, or would simply moving the grub to a different partition solve the problem? Could we decide on what would be the best solution to my problem, and could you give me more in-depth instructions on how to fix the problem. Thanks for the help.

The FIXMBR command in the windows recovery console will *REMOVE* grub,
and restore the Windows boot loader. Since you deleted Ubuntu I
assume your goal is to not have it any longer, and return to a pure
Windows system. If you are still having trouble booting Windows after
doing that you will need to contact Microsoft for technical support.

There seem to many a number of issues here, but the fact is that Grub installed itself over the windows boot sector, not the MBR. Wiping out the partition boot sector prevents Windows from booting, whereas replacing the bootloader in the MBR is normal (obviously). The bug I reported was supposed to *PREVENT* grub from ever installing to the Windows partition (this used to be offered in the drop down box as the target for Grub2 while installing - in Ubiquity) but should not be offered now. But if it's not offered, then the question is how does Grub get installed to the Windows partition? The only way I know is to manually do it with grub-install /dev/sda1 --force but clearly new users are not doing this. Therefore my point about the possible regression.

Running FIXMBR won't do a thing in this case. Until the bootsector is repaired Windows cannot boot.

bcbc, since the reporter is no longer using Ubuntu, and there's a lot of noise and little signal here, there's no point in keeping this bug open. If you think there has been a regression in bug #576724, then follow up there.