Install Windows 7 on a disk containing MBR for another OS while preserving the second OS in place

07
2014-07
  • EugeneP

    I have 2 hard disk drives, c:\ (80 gb) and d:\ (300 gb) Current Windows XP installation is on the second disk (D), but MBR is on the first (C) disk.

    I want to format the C (first) disk and install Windows 7 on it. But I want to preserve the XP installation on D disk and be able to boot either OS.

    All my programs files for XP reside on disk 2, including d:\Windows, d:\System, if there are any system files on C, then the OS put it there itself and I could not control that process neither can I say where and what those files are.

    My question is, how to install win7 on the first disk drive and then to be able to boot both OS ? Again, MBR is on the disk that I want to format (to install Windows 7 there).

    What tools etc should I use? (One I found is easybcd)

  • Answers
  • JdeBP

    First: As you are about to find out when installing Windows 7, describing hard disc layouts in terms of drive letters is useless and uninformative. Different operating systems assign different drive letters to the same volumes, and what's C: for one operating system can be S: or even no drive letter at all for another. Moreover, drive letters don't denote discs in any case, but volumes. Microsoft provides a tool for just this sort of situation, where you want to obtain and pass on information about your discs to other people. It is the diskpart command, and the output of its list disk and list partition commands can be easily copied and pasted into things like SuperUser questions.

    Second: You have a Master Boot Record on both discs. It's a fundamental aspect of the partition layout. What is the case is that only the bootstrap code contained in the MBR on your first disc is being executed. (This is modifiable with many modern machine firmwares. The boot order menu in the setup utility controls which disc has its sector #0 loaded and run.)

    The bootstrap code in your MBR that was installed by Windows XP is largely irrelevant to installation of Windows 7. There are functional differences, but they lie in areas that are unlikely to affect you. (The Windows 7 MBR bootstrap program does not accommodate old machines that don't support some firmware APIs for disc access that have been around since 1994 and common since 1997.) So even if Windows 7 does update the MBR bootstrap program, the operation of your system should be largely unchanged. The new bootstrap program does what the old one does, except that it no longer has a fallback compatibility mode for old machines.

    It's not the MBR that is the concern. It is your system partition. If, as you say it is, your Windows XP boot partition is on a secondary physical disc, with the system bootstrapping from the primary physical disc, then your system volume is already separate from your boot volume. This is a good thing. Indeed, Microsoft provides a lengthy procedure for those people unlike you who don't yet have separate system and boot volumes and who want to have Windows 7 alongside Windows XP.

    Windows 7 installation will update the system volume, replacing the bootstrap program in its Volume Boot Record with a new one that loads and invokes the Microsoft Boot Manager, which Windows 7 will also install to the system partition. To obtain a multiple-boot arrangement, it is then simply necessary to tell the Microsoft Boot Manager, in your system volume, about the Windows XP operating system loader and to add it to its menu. M. McTavish provides the commands to do this:

    bcdedit /create {ntldr} /d “Windows XP”
    bcdedit /set {ntldr} device partition=\Device\HarddiskVolume1
    bcdedit /set {ntldr} path \ntldr
    bcdedit /displayorder {ntldr} /addlast

    bcdedit comes in the box, and that and the Windows installation utility — as Microsoft's fairly superficial view of the process explains — are pretty much all that you need. You don't really need anything else.


  • Related Question

    linux - Will installing Windows on a separate disk mess up my existing MBR?
  • bedwyr

    I have a spare HDD sitting around I'd like to put Win XP on; it's currently formatted/mounted as an extra NTFS volume on my Ubuntu 9.10 install.

    If I install XP on the drive, will it wipe-out/modify my existing MBR? I haven't dealt with Windows in so long, I can't remember how it behaves when dual-booting from a separate disk.

    Here's the setup I have:

    • Primary Drive: 3-partition, ext4: /home, /, swap
    • Secondary Drive: 1-partition, NTFS

    My concern is wiping out the MBR which allows me to boot into my Linux system. Since it's being installed on a separate volume, I would expect my Linux data to be safe; I'm just not sure if it will screw up the MBR, causing me more headaches when trying to boot into Linux.


  • Related Answers
  • quack quixote

    The best thing to do would be disconnect your primary drive during the installation. WinXP's installer will write itself to the MBR, but after the installation is complete, your BIOS should boot to your reconnected primary drive and you'll get the Grub menu.

    Add this to Grub v1's menu.lst file to add a menu entry for the new installation (assuming WinXP installed on the secondary drive's first partition):

    title          Windows XP Pro
    root           (hd1,0)
    makeactive
    chainloader    +1
    

    Note you may need to update Grub's devices.map file to specify what device (hd1,0) is.

  • Niek Bergman

    Unfortunately, I am not sure if installing Windows this way will mess up your MBR (I'm more of a Linux user myself ;))

    However, you should be able to recover the MBR in case this happens by following the guide available at https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

    Hope this helps.

  • John T

    You should have no problem installing XP to a slave drive, as long as the BIOS is set to boot from the first hard disk. The MBR should be written to the disk you specify when installing.