Hi everyone,
Yippie!

I've managed to do what I wanted. This took me some hours to figure out (I had to reinstall windows and boot again and again)

, so to help you other guys who'd like to install windows on a second drive on a system where they are not allowed to change the boot order, here's a small how-to.
Setting and goal:
- I've got a laptop containing an in-built hard drive containing a Safeguard-easy encrypted Windows XP and a freshly installed second (ejectable) drive. I wanted to install Windows 7 to the second drive without modifying any data on the first hard drive.
- To select from which drive to boot, I wanted to use the boot manager offered by the BIOS (simply by selecting from which drive to boot upon start-up)
- My description might also work e.g. for creating a bootable USB-drive (I haven't tried this, however)
WARNING: The actions that I'm describing below may destroy your data. I haven't gone too much into detail, but an experienced windows user should be able to make use of the instructions. If you follow this guide, be careful to know what you're doing (e.g. by looking up the commands that I'm describing before executing them).Use this information at your own risk!
Another Caveat: I am describing what worked for me. It is possible that there are more efficient ways to proceed and that I took some unneccessary steps - if you've got suggestions how to improve this guide, feel free to comment.
The problem:
- After installing windows 7, I wasn't able to boot my Windows XP system any longer. It seems that the installation changed the Master Boot Record (MBR) on the first drive and additionally damaged the boot partition on the first drive. I don't know for sure, but I believe that Windows 7 might have copied its boot manager to the first partition on the first drive, thus damaging the encrypted file system.
- The easiest way to accomplish my intended installation would probably have been to modify the boot order in the BIOS, install Windows 7 and then restore the boot order. However, I didn't have the required BIOS password and privileges to do so.
The solution: My solution was this:
- Backup the first hard drive
- Install Windows 7 to the second hard drive (destroying the installation on the my first drive while doing so)
- Make the second hard drive bootable
- Restore the first drive
I am describing the steps below:
1. Backup the first hard drive
You can use any suitable backup tool which is able to do a backup of the complete disk. Make sure to backup not only the partitions but also the MBR. I am not familiar with backup tools on windows, so I used Knoppix (a Linux which is bootable from CD) and stored the partitions of my first drive on a USB drive. On my system, the first hard drive is called /dev/sda. So, I executed the following commands on the shell and from within a directory on the USB drive.
To backup the MBR, including the partition table:
> dd if=/dev/sda of=mbr_sda.dd bs=512 count=1
To backup the partition on the first hard drive:
> dd if=/dev/sda1 | gzip -d > backup_sda1.dd.gz
2. Install Windows 7
I installed Windows 7 from DVD to the second drive and checked that it was able to boot up.
3. Make the second drive bootable
This was the tricky part and took me quite a while. To understand what I did, you need to know how windows 7 boots up:
- When booting from a drive, the BIOS uses the Master Boot Record (MBR) on that drive to find out where the partitions are and which partition is active
- Afterwards, the code in the Partition Boot Record (PBR) of the active partition is executed.
- The windows 7 PBR then executes the windows boot manager <boot partition>\bootmgr.
- The windows 7 boot manager loads its configuration file from <boot partition>\boot\BCD and starts the system (the BCD-file contains the boot menu displayed upon startup when you've got more than one system installed)
So, in order to make a drive bootable, one needs to install a valid MBR on the boot drive, a valid PBR on the boot partition (assumed to be C: in the following), the boot manager C:\bootmgr, the C:\boot\ directory and a valid C:\boot\BCD file.
Here's what I did to install everything (again, there may be a simpler way - this is what worked for me):
- After installing windows 7, I booted from the Windows 7 DVD, selected "Repair Computer" and opened a command shell. On the shell, I used
> diskpart
and then commands like "list disk", "select disk", "list partition" and "list volume" to investigate what drive letters were assigned to my partitions.
- As it turned out, the first partition on the 2nd drive was called C: and the windows DVD was called H:. After exiting diskpart, I used the command
> H:\boot\bootrec /nt60 c: /mbr
to install the MBR and the PBR.
- I would have loved to use bootrec with its command line options /fixMBR, /fixBoot, or /rebuildBCD to install the remaining parts - however, no matter what I tried, the command "bootrec /ScanOs" wouldn't recognize a valid windows installation on C:\ and I wasn't able to figure out how to use the command line options /fixMBR, /fixBoot, or /rebuildBCD to force the installation of the bootmgr file or the \boot directory on C:
- I was neither able to figure out where the windows 7 installation had put the bootmgr file or the \boot directory on my laptop (probably somewhere on the first partition on the first drive, thus destroying the encrypted file system), so I copied H:\bootmgr from the windows installation DVD to C:\. Additionally, I used a USB stick to copy the C:\boot directory - except the C:\boot\BCD file - from another windows 7 installation to C:\ on my laptop - (luckily, I've got a second computer running windows 7 - otherwise it might have been a lot of work to obtain a working \boot directory).
- The C:\boot\BCD file was still missing at this point, so I couldn't boot directly from the 2nd hard drive. So I booted windows 7 using the boot loader on the first hard drive. On the running windows 7 system, I tried to create the BCD file using the command line tool "bcdedit", but after a while of messing around, I found the easy to use freeware tool EasyBCD, used this to create the BCD file, rebooted - and voilá: I was able to boot from the 2nd drive.
4. Restore the first drive
After checking that I was able to boot from the second drive using the BIOS boot menu, I restored my first partition. I started up knoppix again and used the backups created as described above to
- Restore the MBR (and partition table
> dd if=mbr_sda.dd of=/dev/sda
Warning: don't try to copy an MBR from one drive to another by this command as the MBR contains the partition table which would be overwritten using this command. If you want to copy the MBR only, you can try dd if=/dev/sdb of=/dev/sda bs=446 count=1 - but as I understand it the MBR ist drive specific, so you shouldn't copy it from one drive to another at all.
- Restore the boot partition on the first drive:
> gzip -dc backup_sda1.dd.gz | dd of=/dev/sda1
Conclusions
Finally: that's it - Phew! I don't understand why Microsoft makes it that difficult for an experienced windows user to install a windows system to a second drive without damaging other systems on the same computer :-?.
I am not going to opimize this - if you know an easier way or if you've got remarks, feel free to comment!
Cheers,
Andi