Fixing bad Windows partition and startup with Linux

5,324

Solution 1

Go download one of the Windows 7 ISO images and burn it to DVD.

http://www.mydigitallife.info/download-windows-7-iso-official-32-bit-and-64-bit-direct-download-links/

Then you need to boot to the recovery console, and use the BCDEdit Command:

http://technet.microsoft.com/en-us/library/cc709667(WS.10).aspx

http://support.microsoft.com/kb/919529 (not specifically your problem, but tells about how to fix boot problems)

What happened is when you deleted the partition, you threw off the boot information stored in the BCD store (same function as the old boot.ini)

Solution 2

"Invalid partition table" has nothing to do with the BCD store. It's an error from MBR bootstrap code that indicates that the MBR partition table information has undefined status bytes for one or more primary partitions. It's actually quite hard to get and still have something that everything else considers to be a valid partition table, as here.

Looking at the information you supplied, it becomes apparent that for some reason you have MBR bootstrap code in the VBR of your first primary partition. Naturally, that MBR code cannot find an embedded partition table. (It just finds some scrambled data from the real VBR that you overwrote.) You probably overwrote the VBR with that ms-sys command.

It's fixboot in the Windows recovery environment that you should be looking at, not fixmbr. Of course, you've just deleted your recovery environment. …

Share:
5,324

Related videos on Youtube

jonallard
Author by

jonallard

Updated on September 18, 2022

Comments

  • jonallard
    jonallard over 1 year

    Here is what happened:

    • Don't have enough space on my Windows partition
    • Delete the stock "recovery" partition to make space
    • Enlarge the Win partition
    • Software messes up the Windows boot
    • Go under Ubuntu to fix the problem
    • Try to fix the Win7 MBR with ms-sys -7
    • Upgrade to Natty at the same time
    • Flush the old GRUB, in the process, put a new one
    • grub-mkconfig doesn't detect Windows
    • Make up a Windows booting entry
    • Try booting Windows
    • Receive error "Invalid partition table"

    Now I don't have any OS CD/DVD (Windows, Linux), so I have to work with what I have.

    Here is my Boot Info Script

    My Windows partition is on /dev/sda1, but probably messed up in some way, and my GRUB script says this:

    menuentry "Windows 7 (loader)"{
        set root=(hd0,1)
        chainloader +1
        boot
    }
    

    How do I make Windows 7 boot again?

    • jonallard
      jonallard almost 13 years
      So I went and fixed my Windows partition (so "Invalid partition table" isn't an issue anymore), I have only yet to figure out how to boot it. (I think) I have GRUB on the MBR, so that's not the problem, but the Windows7 bootloader is gone (to which I would have to use bootrec /fixboot under Win). The question really is: Can a bad Windows 7 boot sector/loader (not MBR) be fixed using Linux? (such as having the equivalent of fixboot in a Linux application)
  • jonallard
    jonallard almost 13 years
    I don't have any DVDs and I don't think I can burn a DVD. I'm looking for a way to do it without the recovery CD or Windows CD. Also, I didn't delete the partition, but resized it.
  • hicklypups
    hicklypups almost 13 years
    @jonallard What you are describing, you will never solve without a DVD. You need a tool you just do not have: BCDEdit. Get a friend to burn it for you if you have to.
  • JdeBP
    JdeBP almost 13 years
    "Invalid partition table" has nothing to do with the BCD store.
  • hicklypups
    hicklypups almost 13 years
    @JdeBP I agree, but he ALSO changed where the BCD tries to boot from when he deleted that utility partition FIRST, which led to him going further, and then making it worse. I should have addressed that too in my answer, but I am not wrong with regards to him needing BCDEdit.
  • JdeBP
    JdeBP almost 13 years
    Xe probably didn't change the BCD mapping. (BCD is Boot Configuration Data. It isn't an active entity. It is MS Boot Manager that boots.) Xe probably deleted it outright. That "stock recovery partition" was probably, in addition to being the tool for recovering from this very situation, a Windows 7 System Reserved partition, which is actually the Windows 7 boot volume. But finding that out requires fixboot first, to discover whether MS Boot Manager was on that or the now remaining volume.
  • hicklypups
    hicklypups almost 13 years
    @JdeBP His BCD store, assuming disk 0), pointed to disk 0, partition 2...once he deleted the utility partition, it needed to point to disk 0, partition 1. THAT was the initial problem. This has been a problem for people going back to NT 3.5, although it was handled then in the boot.ini file. Yes, he screwed it up beyond that, and I should have commented on it, but had he fixed this first, he would not have as many problems. I did so mostly be because he said "I don't have disks, blah blah blah"...well he NEEDS something beyond what he has, and that was the point I wanted to make.
  • JdeBP
    JdeBP almost 13 years
    You're not getting it. Read what I wrote again. The BCD store was probably on the deleted partition, alongside MS Boot Manager. You're worrying about mapping mismatches before jonallard has even proven that the boot manager and BCD store still exist, by fixing the VBR and seeing whether it cranks up MS Boot Manager. As I pointed out, xe hasn't got beyond a message issued by code in a boot record.
  • hicklypups
    hicklypups almost 13 years
    @JdeBP Ahh, sorry...got it now. I assumed that that partition was a utility partition, not that little one that Windows 7 likes to create, so very possible, for sure. In that case, he would still use BCDEdit to create a new one.