I wanted a dual-boot setup. So first I installed Windows 7 on the 1st partition of one hard drive (we'll call it HDD1), and then I went to install Ubuntu 9.10 on the second partition of HDD1. Unfortunately, this didn't work (it bypassed GRUB2 and went straight into Windows). I decided to reinstall Ubuntu, and that's when I noticed that (for some reason) Windows decided to place its boot files on another hard drive (we'll call it HDD3).

I'd like to fix this - I want to move the boot files from HDD3 to HDD1. It may help fix my dual-boot issue, but even if it doesn't, in my experience, it'll save a lot of headaches down the road. How can I do this? I'm going to assume its not as easy as just copying the files, but I'd like to be proven wrong :)

link|improve this question
feedback

3 Answers

Through some Googling, I found the following solution (I use HDD1 and HDD3 to represent the two hard drives I care about, as referenced above in my question):

  1. The boot files consist of a folder called "Boot" and an application called "bootmgr". They are system files, and so are normally hidden. You must make them visible.
  2. Copy them both from HDD3 to HDD1. It will complain that two files cannot be copied: "BCD" and "BCD.log", both of which are in the "Boot" folder. The latter is unimportant (its just a log file) and can be ignored; the former will be copied in the next step.
  3. Open a command prompt with Administrator privileges. Type the following command "bcdedit /export HDD1:\Boot\BCD", where HDD1 is the driver letter of your destination drive. In my case, HDD1 was C, so the command was "bcdedit /export C:\Boot\BCD".
  4. Now, you have to edit the BCD file so that the entries are all correct. I used the bcdedit program which comes with Windows 7, but there are others. I've heard EasyBCD is pretty good (and free), but the latest version doesn't fully support Windows 7. I believe a new version that does support Windows 7 will be out shortly. First, I navigate to HDD1\Boot on the command prompt (with Admin privileges) and type "bcdedit /store BCD /enum ALL". I use the /store switch to specify the BCD file in the current directory - omitting this switch will use the default one I think, which is on HDD3. This command lists all the entries in the BCD file.
  5. I scanned the entries, and it turns out that the entries for {bootmgr} and {memdiag} both point to HDD3. Of course, I want them to point to HDD1. So I issue commands in the following form: "bcdedit /store BCD /set [entry name] device partition=HDD1:". Since HDD1 is C on my machine, I would type the following to set the {bootmgr} entry: "bcdedit /store BCD /set {bootmgr} device partition=C:".

That's about it. One last step is to make HDD1 Active via Disk Management (accessed from Computer Management) - it was already Active on my system, so I didn't have to do anything.

Now, as for the weird dual-boot problem, it turns out I forgot that I had physically switched the order of the hard drives. As such, the BIOS boot order was incorrect (it was trying to boot from HDD3 first, instead of HDD1). And yes, that was an incredibly stupid mistake on my part :)

link|improve this answer
second step of attrib should not be necessary as attrrib flags on original file are +a only – user30436 Mar 7 '10 at 10:12
These instructions are very usful. I have several dual boot machines using Win7 and Ubuntu and over time I have found the best permanent solution to this is BootIT NG terabyteunlimited.com/bootit-next-generation.htm. – jtreser Mar 7 '10 at 12:00
feedback

Hey thanks for the info, I've been in a similar situation before and it's always a headache. I got myself into this mess again with Windows 7 and your post helped a ton, but one missing detail kept me frustrated. The new BCD on HDD1, even after editing and making partition active, wasn't being used and it wasn't until I used the following in a command prompt "attrib bcd +s +h +r"

link|improve this answer
feedback

The easiest way is to just download and install the free EasyBCD: http://neosmart.net/dl.php?id=1

On the "BCD Backup/Repair" page of EasyBCD, there's an option called "Change Boot Drive" which will bring up a list of all local disks. You just pick the disk you want, and EasyBCD will automate the entire process for you, including making the selected partition active and bootable, importing the old bootloader contents, and writing the MBR.

(Disclosure: I'm the author of EasyBCD)

link|improve this answer
feedback

protected by random Oct 28 '10 at 0:16

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.