Install windows 7 on 2nd HD without damaging OS on 1st HD?

Discussion in 'Windows 7 Installation' started by AndiHan, Oct 2, 2010.

  1. AndiHan

    AndiHan New Member

    Joined:
    Oct 2, 2010
    Messages:
    6
    Likes Received:
    0
    Hello everyone,

    after trying for several hours to install windows 7, I hope that I can find help here. I am trying to install windows 7 to the second hard drive in my laptop in a manner which ignores the first hard drive completely.

    My laptop contains 2 hard drives. The first drive (with respect to boot order) contains a Safeguard-Easy-encrypted Windows XP, and I would like to install Windows 7 to the second hard drive. After installing Windows 7, I would like to be able to select the hard drive to boot from using the boot menu of the laptop's BIOS.

    The installation went smoothless, but - as expected - damaged the MBR and the bootloader on my first hard drive.

    I am able to repair the first hard drive (using Linux and the dd command line tool), but even after hours of googling and trying, I cannot figure out how to manage to obtain a working windows installation on the second hard drive - I've tried several things: I copied the MBR from the first hard drive to the second, I copied the first blocks of the primary partition of my first hard drive to the second, but all this didn't help. When booting from the windows DVD, I cannot use the bootsect.exe tool as only the partitions of the first drive are visible (parted.exe shows the second drive but not it's partitions, even if I select the second drive to be active).

    Can anyone give me any hints on how to proceed? The easiest way to proceed would probably be to change the boot order in the BIOS and then install, but I don't have the rights to do so.

    Cheers,
    Andi
     
  2. cybercore

    cybercore New Member

    Joined:
    Jul 7, 2009
    Messages:
    15,823
    Likes Received:
    321
  3. AndiHan

    AndiHan New Member

    Joined:
    Oct 2, 2010
    Messages:
    6
    Likes Received:
    0
    Hi,

    thanks for your answer - regrettably, I don't see how this helps. I want to make my 2nd hard drive bootable without the 1st hard drive being modified.

    After trying around for hours, I am still stuck. I've got windows 7 installed on my 2nd harddrive, but I can start it only by booting from the 1st harddrive.

    I used bootrec.exe to write the MBR and PBR and to the 2nd hard drive. However, when trying to boot from the second hard drive I receive the message "the windows boot configuration data file is missing required information".

    How can I create this configuration file? (I have already copied bootmgr and the c:\boot directory from another windows 7 installation to my new system, but I don't know how to get the BCD file - maybe this is the file which is missing? I also tried bcdedit /createrepository or so).

    Cheers,
    Andi
     
  4. AndiHan

    AndiHan New Member

    Joined:
    Oct 2, 2010
    Messages:
    6
    Likes Received:
    0
    Hi everyone,

    Yippie! :p 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:

    1. Backup the first hard drive
    2. Install Windows 7 to the second hard drive (destroying the installation on the my first drive while doing so)
    3. Make the second hard drive bootable
    4. 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
     
  5. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    I would have probably removed the XP drive and installed Win 7 as an independent OS. Depending on your system, you might have needed to move the Win 7 drive to the other slot.

    Then the system would boot to the first drive in the boot order or you could use an F key to choose which drive to boot to, if you have that option.
     

Share This Page

Loading...