Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I needed more space on my Ubuntu partition so I shrunk my Windows 7 partition by 25GB and then went into GParted on a live USB so I could extend my Ubuntu partition. At the same time I deleted the recovery partition for Windows 7 (I figured I always have the installation discs on me anyway and that 100MB partition was getting on my nerves) and shifted the Windows partition over to the beginning. Here's a rough picture:

|-recov part-| |-----windows part-----| |--ubuntu part--|

Changed to:

|----windows part----| |---ubuntu part---|

Once I did this nothing would boot (black screen with blinking underscore) so I reinstalled Grub and was able to get into Ubuntu again. However every time I tried to get into Windows 7 I was greeted with a black screen with a blinking underscore in the top left corner of the screen. Since then I've tried several things with the Windows installation CD (not necessarily in order):

  • Set windows partition as active then used startup repair three times with a reboot between each one
  • The following commands:

    bootrec /fixboot
    bootrec /fixmbr (required me to restore Grub later)
    bootrec /rebuildbcd
    bootsect /nt60 C:
    bcdboot C:\Windows /s C:
    
  • Used TestDisk to rewrite the partition table (made sure it is not dynamic disk from Windows install disk repair prompt)

All to no avail (still gets stuck at the black screen after BIOS). I know it's not a hardware problem since I'm in the Ubuntu partition on the same disk as I type this. One thing I noticed is that the Windows partition is now /dev/sda1 instead of /dev/sda2 (I believe it used to be sda2 before all this).

I have two ideas and no clue how to fix either:

  1. Windows still thinks it should be /dev/sda2 instead of /dev/sda1 which is causing a problem

  2. The Windows bootloader thinks the OS starts at its old location on the physical disk instead of its new one

Any clues?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

I followed this solution to restore my 100 mb boot partition:

Removing Linux Partition on Windows 7 machine

then updated grub and was able to get back into windows.

share|improve this answer
add comment

The Windows bootloader was located on that 100MB partition that you deleted. That's why it won't boot.

One apparently necessary thing that you missed while trying to recover this is setting the Windows partition as active before running Startup Repair three times.

You can set the Windows partition as active in your Ubuntu installation by running sudo gparted. Once you've done this, run Startup Repair three times as before.

Once you've completed recovery and Windows is booting normally, set the Linux /boot partition as active using Windows to restore your grub dual boot.

share|improve this answer
    
I've already set the 'boot' flag for the windows partition before trying the startup repair three times. I forgot to mention this above. –  vshah23 Jul 31 '12 at 6:48
add comment

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.