Manual BCD Creation

#1
Hey guys,

I had Vista / 7 Dual booting and decided to overwrite Vista with Linux as I hadn't booted Vista in awhile. I've side by side installed Windows and Linux many times without a problem,.... until now (of course :smile: )

It appears that my /boot folder with BCD was all along on the Vista partition. I didn't realize this till it was already too late and Windows wouldn't boot, so I have no BCD backup.

None of the "easy" bootsect / bootrec commands seemed to get the job done, so I tried the manual "nuclear holocaust" approach from here:

Recovering the Vista Bootloader from the DVD - NeoSmart Technologies Wiki

At one point (the import command i believe) I got an error about device not found. A google search mentioned this is because the partition was not set active. I tried to set the partition active using diskpart but it gave me an error saying this partition was not valid for the active flag. I was able to set active using gparted from the Linux partition and then bcdedit allowed me to use import / complete the manual bcd creation.

However, I am still unable to boot into Windows. I am thinking whatever prevented diskpart from flagging the drive "active" might be the problem? I think I've heard MS has their own definition for things like "active" and "boot". Are there particular rules like /boot needs to be on a primary partition or that sort of thing? Not sure if its coincidence but Vista had been located on the first partition whereas the Win7 partition is the third or fourth on the disk.

Thanks for any tips, its what I get for not using easybcd to switch the boot drive!
 

mqudsi

Mostly Harmless
Staff member
#2
It seems that your remaining Windows partition is logical and not primary.

You'll need to convert it to a primary partition using GParted, PartitionMagic, or Acronis DiskDirector.
 
#3
Indeed it is logical, I was thinking that might be the issue but couldn't quite find conclusive evidence for it. I should be able to use gparted for this then. Will hope for a non-destructive operation, then!
 

mqudsi

Mostly Harmless
Staff member
#4
I know that PartitionMagic has a a non-destructive approach, I'm not sure about GParted.

Come to think of it - I'm not sure why *any* software should be destruction in the conversion from Logical to Primary. It's just math, so long as you don't exceed the 4 primary partitions maximum.
 
#6
Thanks for the help guys, I was able to use PW to set the partition to primary and active. This seems to have improved things, but I am still not quite out of the woods. The win7 recovery CD now sees the install in the correct location and attempt to fix it automatically. Previously it could find no installs. The problem is that after the first time when it said it fixed something it now tells me that everything is good / normal but when I try to boot I still get a "Disk Read Error Press Ctrl + Alt + Del to reboot". A few random thoughts

* Theres no rule about which primary partition right, just needs to be the active primary? I believe this is the 2nd primary partition on the drive with the 1st one containing MP3s and such user data.

* I'm not sure if I confused it with all the things i did trying to fix it before fixing the partition. I booted into Linux and removed everything in /boot so that it could start fresh. It came up, said it fixed it (and did create a BCD), but is there anything else residual i might need to clean up?

* I read somewhere that having GRUB on a different partition can cause the recovery wizard to mess up and i need to clean it off the Linux partition? Any truth to that? Seems strange as long as the MBR is written by Windows, which it should be (bootsect /fixmbr).

Thanks Again!
 
#7
Thanks for the help guys, I was able to use PW to set the partition to primary and active. This seems to have improved things, but I am still not quite out of the woods. The win7 recovery CD now sees the install in the correct location and attempt to fix it automatically. Previously it could find no installs. The problem is that after the first time when it said it fixed something it now tells me that everything is good / normal but when I try to boot I still get a "Disk Read Error Press Ctrl + Alt + Del to reboot". A few random thoughts

* Theres no rule about which primary partition right, just needs to be the active primary? I believe this is the 2nd primary partition on the drive with the 1st one containing MP3s and such user data.
Correct. There is no rule about which primary partition to use, though the partition you set to active of course needs to have the boot files on it, and configured correctly.
* I'm not sure if I confused it with all the things i did trying to fix it before fixing the partition. I booted into Linux and removed everything in /boot so that it could start fresh. It came up, said it fixed it (and did create a BCD), but is there anything else residual i might need to clean up?
You shouldn't have done that. The Linux boot files wont tamper with your Windows boot (or the Windows startup repair) if that's what you're concerned about. Now before you can get back into Linux, you'll have to reinstall Grub to the partition.
EDIT: Nevermind. I see you're talking about the /boot folder on the Windows partition that contains the BCD.
* I read somewhere that having GRUB on a different partition can cause the recovery wizard to mess up and i need to clean it off the Linux partition? Any truth to that? Seems strange as long as the MBR is written by Windows, which it should be (bootsect /fixmbr).
Thanks Again!
That's false. The Grub files on the Linux partition wont affect the Windows startup repair at all, as Windows can't read Linux filesystems to begin with. And even if Grub was installed to the MBR, Windows startup repair usually is able to put the Windows MBR back. You should try running it at least two more times, as startup repair is too dumb to fix everything with one pass. :wink:
 
Last edited: