Question Unable to rebuild BCD after cloning SSD ?

guayabo

Honorable
Dec 17, 2017
40
2
10,535
Hi all! Will try to keep this as short as possible but provide some context in case it's relevant.

I bought a new SSD and want to use it as my Windows 10 OS drive without starting from scratch. Converted the new drive to GPT with:
Code:
diskpart
list disk
sel disk 3
clean
convert gpt

Then I used Macrium reflect to clone all existing partitions from my original SSD to the new one:

lfM3DHT.jpeg


Once i booted it i'm getting these errors:
2CUKHDE.jpeg

nCf56Us.jpeg


And here's what i tried so far from a bootable W10 22H2 installer USB (sorry for them being images instead of plain text, couldn't figure out how to export the entire command history to a text file without some info being left out along the way).
2QunUqF.jpeg

SRvdJyG.jpeg


Still no luck after running these commands.

I found a similar case here and it seems like they couldn't figure it out.
Also from this post it looks like trying to rebuild the BCD from a bootable USB through a USB 3.0 port / Legacy BIOS mode doesn't work in some systems. I made sure to try multiple USB 3.0 and 2.0 ports and boot in UEFI from my boot loader.

Previously tried cloning everything and keeping the new SSD on MBR as well (my current SSD is MBR-Legacy) but was having more issues when trying to run bootrec /fixboot. Now it seems like that runs fine in GPT, but i'm out of ideas.

Any help would be really appreciated!
 
Solution
Just realized i forgot to include the last bcdboot command which is arguably the most important one,
Redo last part commands from post #10 and show screenshot.

diskpart
list disk
select disk 0
(select 447GB disk)
list partition
select partition 2
(select 549MB partition)
assign letter=K
exit
bcdboot C:\windows /s K: /f UEFI

Last message should be "Boot files created successfully".
C: - 445GB partition, double check drive letter assignments and change command accordingly.

Have Secure boot disabled,
Fast boot disabled,
First boot option set to Windows Boot Manager...

guayabo

Honorable
Dec 17, 2017
40
2
10,535
why did you use diskpart? can't macroum clone the drive including the formats?
I couldn't find any option in Macrium which would let me choose the disk format when cloning. I did a clone with macrium two times, the first time around i didn't use diskpart and cloned as is, both my source and target ssds were in MBR and that's initially when i saw the boot error. After running all of the commands and possible fixes i could find, the last thing thing i tried before posting here was to wipe it clean with diskpart, convert it to GPT and try the same commands again.
 
is Macrium reflect up to date?

did you remove the old drive after cloning and before restart?

EasyBCD tool helped me a lot in the past, maybe it can help with GPT BCD as well

secure boot could be a problem as well

mixing up mbr and gpt/UEFI should be the thing here "fixmbr" is not the command you should use, if your are on GPT partitions
get into the command prompt and type:
  1. diskpart, sel disk 0, list vol, sel vol X (X is the volume of the EFI-Partition (ESP),which uses FAT32)
  2. assign letter=V:" for V you can chose any letter, which is still available
  3. exit to exit Diskpart
  4. cd /d V:\EFI\Microsoft\Boot\ V=letter chosen earlier
  5. bootrec /FixBoot
  6. ren BCD BCD.old" to backup the current boot entries
  7. bcdboot c:\Windows /l en-us /s V: /f ALL to repair the boot entries

which SSDs are you cloning? maybe a different clone tool can help
 
Last edited:
I bought a new SSD and want to use it as my OS without starting from scratch. Converted the new drive to GPT with:
Code:
diskpart
list disk
sel disk 3
clean
convert gpt

Then used Macrium reflect to clone all existing partitions from my original SSD to the new one:
Your source drive is MBR.
Why did you convert target drive to GPT?

If you clone partitions from MBR to GPT, result is not bootable.
On MBR drives bootable partition is of type Primary, Active.
On GPT drives bootable partition is of type EFI system.
You'd have to recreate bootloader manually then.

Just use MBR and redo cloning.
 
Last edited:
Previously tried cloning everything and keeping the new SSD on MBR as well (my current SSD is MBR-Legacy) but was having more issues when trying to run bootrec /fixboot. Now it seems like that runs fine in GPT, but i'm out of ideas.

Any help would be really appreciated!
If you want to go hard way and recreate bootloader to be EFI compatible then execute following:
diskpart
list disk
select disk 0
(select 447GB disk)
list partition
select partition 2
(select 549MB partition)
delete partition
create partition efi
format fs=fat32 quick
assign letter=K
exit
bcdboot D:\windows /s K: /f UEFI
(Double check OS drive drive letter. In your screenshot 445GB partition was D: , Drive letters can change in recovery environment. Modify bcdboot command accordingly to OS drive drive letter.)

There should be no errors.
Last message should be "Boot files created successfully".

Show screenshot, if there were errors.
 

guayabo

Honorable
Dec 17, 2017
40
2
10,535
Hey all, thank you for trying to help me on this. Just had a chance to try these but no luck yet.

Also i want to clarify just in case, that while in i'm in the windows installer usb environment running the cmd commands i unplug all my original drives. The last thing i want is to accidentally mess up the BCD on my original SSD. So the only two drives are the USB and the cloned SSD.
show screenshot from bcdedit command
LiiuAI6.png


is Macrium reflect up to date?

did you remove the old drive after cloning and before restart?
Yes for both. Macrium is on v8.1.8017 (free trial, downloaded it just for this, but wouldn't assume it matters?)
EasyBCD tool helped me a lot in the past, maybe it can help with GPT BCD as well
I had used it in the past as well but forgot about it. Gave it a shot, and interestingly enough when i opened it i saw this

NChVL5Q.png


Which is weird because i'm running it on my original SSD which is set to MBR? I'm definitely missing something here.

Tried it anyways by adding a Windows entry but no luck when trying to boot afterwards:

795jG7h.png


Tried booting both with and without the original SSD connected. When both are connected, the boot loader completely skips the cloned SSD and goes straight to the original one.

diskpart, sel disk 0, list vol, sel vol X
Got stuck here as kerberos_20 mentioned, since X isn't selectable.
 

guayabo

Honorable
Dec 17, 2017
40
2
10,535
Your source drive is MBR.
Why did you convert target drive to GPT?

If you clone partitions from MBR to GPT, result is not bootable.
On MBR drives bootable partition is of type Primary, Active.
On GPT drives bootable partition is of type EFI system.
You'd have to recreate bootloader manually then.

Just use MBR and redo cloning.
The first time around i cloned it i used MBR on both drives, and that's when i started running into this, cloned all partititions from the source to the target disk as is.
After trying to rebuild the BCD unsuccessfully, i wiped it and re-cloned it but in GPT instead to see if that'd fix anything. I've read that GPT is newer and better but at this point the main thing i want is to get it to boot (if we can manage to keep it in GPT that'd be nice, but otherwise it's fine too).
 

guayabo

Honorable
Dec 17, 2017
40
2
10,535
If you want to go hard way and recreate bootloader to be EFI compatible then execute following:
diskpart
list disk
select disk 0
(select 447GB disk)
list partition
select partition 2
(select 549MB partition)
delete partition
create partition efi
format fs=fat32 quick
assign letter=K
exit
bcdboot D:\windows /s K: /f UEFI
(Double check OS drive drive letter. In your screenshot 445GB partition was D: , Drive letters can change in recovery environment. Modify bcdboot command accordingly to OS drive drive letter.)

There should be no errors.
Last message should be "Boot files created successfully".

Show screenshot, if there were errors.
Did this and all commands ran correctly, double checked and the main drive was still "D:". When trying to boot afterwards i now get the W10 spinning wheel for roughly 30 seconds and the PC reboots, this process repeats two more times until i get the BSOD error.

t3eKM5l.png

Then booting:
fjwf0Ln.png


G2IUHeJ.png

After pressing F1:

1mii8pt.png


Also noticed this in my MOBO (which is a B450M DS3H if relevant). Tried disabling CSM, but it gets re-enabled after trying to boot the new SSD and going back to the bios (note that when i'm trying to boot with CSM disabled, all MBR drives are disconnected). CMOS is also fine just in case.

YuIXsdE.png


Edit:

Just realized i forgot to include the last bcdboot command which is arguably the most important one, sorry about that! But i exited diskpart and copied it exactly and it went through correctly. Just went back to diskpart to take another picture of how it looks like now:

JTV5H6L.png
 
Last edited:
Just realized i forgot to include the last bcdboot command which is arguably the most important one,
Redo last part commands from post #10 and show screenshot.

diskpart
list disk
select disk 0
(select 447GB disk)
list partition
select partition 2
(select 549MB partition)
assign letter=K
exit
bcdboot C:\windows /s K: /f UEFI

Last message should be "Boot files created successfully".
C: - 445GB partition, double check drive letter assignments and change command accordingly.

Have Secure boot disabled,
Fast boot disabled,
First boot option set to Windows Boot Manager,
Remove all the external USB drives,
Have only single OS drive connected.

If you're trying to boot from OS drive connected with USB adapter (looks like it),
then that will not work.
OS drive has to be connected internally with sata cables.
 
Last edited:
  • Like
Reactions: guayabo
Solution

guayabo

Honorable
Dec 17, 2017
40
2
10,535
Redo last part commands from post #10 and show screenshot.

diskpart
list disk
select disk 0
(select 447GB disk)
list partition
select partition 2
(select 549MB partition)
assign letter=K
exit
bcdboot C:\windows /s K: /f UEFI

Last message should be "Boot files created successfully".
C: - 445GB partition, double check drive letter assignments and change command accordingly.

Have Secure boot disabled,
Fast boot disabled,
First boot option set to Windows Boot Manager,
Remove all the external USB drives,
Have only single OS drive connected.

If you're trying to boot from OS drive connected with USB adapter (looks like it),
then that will not work.
OS drive has to be connected internally with sata cables.
Can't find the tick button on the side to mark as answered, but thank you so much! After repeating the commands, then removing every other drive and connecting the ssd directly to SATA, Windows booted perfectly.