Windows optimize

Migrate to Windows 7 from an XP dual-boot configuration

Greg Shultz shows you how to safely undo a Windows XP and Windows 7 dual-boot system so that you can complete your migration from Windows XP to 7.

In last week's edition of the Windows Vista and Windows 7 Report, "Create a Windows XP and 7 Dual-Boot System Staged for an Easy Migration," I showed you how to resize your existing Windows XP partition and then install Windows 7 in a dual-boot configuration on the same hard disk. As you'll remember, the goal was to make the task of migrating your settings, documents, and applications from XP to Win 7 a much more relaxed experience since you can boot into Windows XP to check out how something is set up and then boot into Windows 7 to re-create the same configuration.

Once you complete your migration and are comfortable working in Windows 7, you'll want to remove the dual-boot configuration, remove Windows XP, and just boot Windows 7 as your primary OS. In this edition of the Windows Vista and Windows 7 Report, I'll show you how to safely undo Windows XP and 7 dual-boot system so that you can complete your migration from Windows XP to Windows 7.

This blog post is also available in PDF format in a free TechRepublic download.

Label the drives

In order to make it easy to identify which partition is which throughout this operation, you need to make sure that each partition or drive is labeled. In either Windows XP or Windows 7, open My Computer and label or rename each drive with the name of the operating system, as shown in Figure A.

Figure A

Labeling each drive, which is a simple rename operation, will make it easy to identify which partition is which throughout this operation.

As you can see here, this screen shot was taken in Windows XP, which in this case assigned the Windows 7 partition to drive E and its partition to drive C. On the other hand, Windows 7 assigns the Windows XP partition to drive D and its partition to drive C. For the purposes of this operation, it really doesn't matter what drive letter is assigned to a partition, because we know that Windows XP is on the first partition and Windows 7 is on the second partition. However, labeling each drive will help you to keep them straight in the event that the drive letter swapping catches you off guard.

Creating a System Image

The first thing that you'll want to do is protect all your hard work by creating a System Image from within Windows7's Backup and Restore. When you do, you'll end up with a complete image of your hard disk that includes both the Windows XP and Windows 7 partitions in a dual-boot configuration. That way, if anything out of the ordinary were to occur as you follow the steps in this procedure, you will be able to return to your current configuration.

To create a system image, you'll need to have a CD-RW/DVD-RW drive, an external hard disk, or access to a network drive. For my system, I used an external hard disk. To access Backup and Restore, click the Start button, type Backup in the Search box, and press [Enter] when Backup and Restore appears in the result pane.

Once you have Backup and Restore up, select Create a System Image, select your backup location, and then launch the operation to create an image of both drives. The procedure is shown in Figure B.

Figure B

Create a system image that contains both drives in the dual-boot configuration as a safety precaution.

Make a data backup

Even though the system image is a backup, you'll want a separate backup of all your data -- at least one and maybe two, just in case. Maybe just make copies of all your data files on CD/DVD or on an external hard disk. While it may sound like overkill, having an extra backup will give you peace of mind.

Copying boot files

When you create a dual-boot system and install Windows 7 on a second partition, Setup installs all the Windows Boot Manager files on the first partition, which in this case is the Windows XP partition. As such, if the goal is to remove the Windows XP partition and boot from the Windows 7 partition, the next step involves copying the Windows Boot Manager files from the Windows XP partition to the Windows 7 partition.

Boot into Windows XP, launch Windows Explorer, pull down the Tools menu, select Folder Options, and on the View tab, make sure that the Show Hidden Files and Folders option is selected and that Hide Extensions for Known File Types and Hide Protected Operating System Files are cleared. Then, access the root of drive C and locate the Boot folder and the bootmgr file, as shown in Figure C.

Figure C

You'll need to make sure that these settings are configured in the Folder Option dialog box in order to be able to see the Windows Boot Manager folder and file.
Now, open a second instance of Windows Explorer, access the root of the Windows 7 partition, which in the case of my example is drive E, and then copy the Boot folder and the bootmgr file from the root of drive C to the root of drive E, as shown in Figure D.

Figure D

You'll need to copy Windows Boot Manager's folder and file from the Windows XP partition to the Windows 7 partition.

Manipulating the partitions

With your system image backup in place and Windows Boot Manager now on the Windows 7 partition, you're ready to delete the Windows XP partition and configure the Windows 7 partition as the main partition. To do so, you'll boot your system from the Windows 7 DVD, access the System Recovery Options toolbox, use the DiskPart command to manipulate the partitions, and then use the BootRec command to enable Windows Boot Manager on the Windows 7 partition.

To begin, insert your Windows 7 DVD, restart your system, and, when prompted, select the option to Boot from the DVD. When the first Install Windows screen appears, select the appropriate language preferences and click Next. On the second Install Windows screen, select the Repair Your Computer option.

When you see the System Recovery Options dialog box, the Windows 7 partition should appear in the list and the Use Recovery Tools option should be selected. To continue, click Next.

When the second System Recovery Options dialog box appears and prompts you to choose a Recovery Tool, as shown in Figure E, select the Command Prompt option. (As you can see, when booting off the CD, the Windows 7 partition is assigned to drive letter D. However, since we labeled the drive, we can tell for sure that it is the correct drive.)

Figure E

You'll select the Command Prompt option from the second System Recovery Options dialog box.

Once the Command Prompt window opens, you'll enter the DiskPart environment and issue a series of commands to select the Windows XP partition, delete it, select the Windows 7 partition, and then make it the active (primary) partition.

  1. Type the command:

Diskpart

  1. Once the Diskpart environment is ready, select first hard disk by typing the command:

Select disk 0

  1. Once the first hard disk has the focus, select the first partition (Windows XP) by typing the command:

Select partition 1

  1. Just for peace of mind, you may want to double-check that you have the Windows XP partition selected by typing the command

Detail partition

  1. Delete the Windows XP partition by typing the command:

Delete partition

  1. Now select the Windows 7 partition by typing the command:

Select partition 2

  1. Make the Windows 7 partition the active primary partition by typing the command:

Active

  1. Exit the DiskPart environment by typing the command:

Exit

At this point, you are ready to enable the Windows Boot Manager on the Windows 7 partition using the BootRec command.

  1. Write the master boot record to the Windows 7 partition by using the command:

Bootrec /fixmbr

  1. Write a new boot sector to the Windows 7 partition by using the command:

Bootrec /fixboot

Now, close the Command Prompt window and click the Restart button in the System Recovery Options dialog box. Be sure to remove the Windows 7 DVD.

Booting Windows 7

When your system restarts, you'll see the Windows Boot Manager menu and Windows 7 should be selected. Keep in mind that even though Windows XP is gone, the menu will still contain an item for it at this point. Allow the system to boot into Windows 7 and log in as you normally would.

To remove the Windows XP item from the Windows Boot Manager menu, you'll use the BCDEdit command. To do so, open a Command Prompt window with Administrator privileges. (Right-click and select Run as Administrator.) Then, type the command:

BCDEdit /delete {ntldr} /f

Now, restart the system and you should boot right into Windows 7.

Further cleanup

If you look at your hard disk with Disk Management, you'll discover that the partition that used to hold Windows XP is still there at the beginning of the disk but that it is marked as unallocated, as shown in Figure F.

Figure F

Unfortunately, Windows 7's Disk Management tool is unable to extend drive C into unallocated space at the beginning of the disk.

If you wish, you can configure the unallocated space as a simple volume and it will become drive D. (Right-click on the unallocated block and select the New Simple Volume command.)

On the other hand you can just leave it be for now, and in a upcoming article, I'll show you how to redistribute that unallocated space to drive C. Unfortunately, since the unallocated space is at the beginning of the disk, Windows 7's Disk Management tool is unable to extend drive C into that space. In order for that to be possible, Disk Management requires that the unallocated space be at the end of the disk.

What's your take?

Using this technique, you can essentially undo a dual-boot configuration and complete your migration from Windows XP to Windows 7. Will you use this procedure? If you have any questions or comments concerning this technique, please take a moment to drop by the TechRepublic Community Forums and let us hear from you.

TechRepublic's Windows Vista and Windows 7 Report newsletter, delivered every Friday, offers tips, news, and scuttlebutt on Vista and Windows 7, including a look at new features in the latest version of the Windows OS. Automatically sign up today!

Read the third article in this series, Capture unallocated disk space from an XP to Windows 7 dual-boot migration, and learn how to redistribute the unallocated space at the beginning of the hard disk back to drive C, thus making Windows 7 the first and only partition on the hard disk.

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

149 comments
mrrman
mrrman

I tried the above process to remove XP however I have IE8 installed and the menus are different that what is shown. Is there another procedure to follow? Thanks

Michael Lumsden
Michael Lumsden

This worked beautifully for me, except I've ended up with no C: partition and Windows 7 on D:. I know I can carry on as it is now and might be lucky with programmes dealing with it but would much prefer to get Win 7 onto a drive called C:! I have a feeling my problem stems from doing the repartitioning from within the Rescue files on the hard drive rather than the DVD (it wouldn't boot through to that stage - I think because I had an external USB drive connected when I tried to reboot from disk). Is there any way I can reassign letter C: to my active D: drive or would I have to start the whole process again to get that result?

Jeff Parker
Jeff Parker

Hi Greg, hopefully you're still checking this blog. I have a dual-boot config and wish to remove Win XP from my PC, and only have Win 7 remaining. The thing though is that I installed Win 7 in a partition on a different physical HDD (Disk 1), i.e. different to the one that Win XP is installed on (Disk 0). I did this because there was not enough room on Disk 0 to create a partition for Win 7. So, what do I need to vary in your instructions given my config? I am also wanting to replace the current (small and slow) Disk 0 with a larger faster one that I have bought and have Win 7 run on it. I wonder what steps I would need to take given that this is my desired end state? Thanks and kind regards, JP

drdoug_au
drdoug_au

I can no longer get XP to load, I just get a blank screen, plus I am having a couple of issues on Win 7 that will be best fixed by a re-install. Can I just install win 7 on C:drive over XP, by putting win 7 disc in dvd drive and selecting it to custom install on C drive and later just format the drive (G) that Win 7 is on and use it as back up space

misfit54
misfit54

I followed all these steps. When I was in diskpart, it gave me an error stating that I couldn't make this type of partition active. I'm in the process of restoring from an image file back-up. Sooo any suggestions would be greatly appreciated.

vkash
vkash

due to some problems i can't start windows xp explorer i can only start task manager and then start a program(any program) to see and copy bootmgr it is required to run xp in GUI( to change folder setting). so can you tell how to do "copying boot files" step using command prompt. I try to copy this file (bootmgr) using windows 7 explorer but it doesnt I can also do all things if you tell me how to how to change setting to show hidden operating system files using command prompt command. if any user know then he/she can e-mail answer at vikashchandola26@gmail.com

chive99
chive99

all worked a treat for me, right up to the last bit. However, once i'd resized the Win7 partition i'm left with Win7 running on D: as the system partition (even when viewed within windows), doesn;t seem a major problem, but i'd feel better with it on c: is there an easy way to manage that?

finmat
finmat

decided to migrate from vista to Win 7 but have an early problem in that I can't copy Boot file. get message "the action can't be completed because the file is open in system. close the file and try again" What now please? John

yhlim1227
yhlim1227

Hi Greg, I have followed your instructions but I made a mistake. I set a wrong partition as active and continue with Bootrec /fixmbr and Bootrec /fixboot commands without noticing it was a wrong partition. When I reboot, there was only a cursor blinking on the screen. So I go into the diskpart again, and this time I use 'detail partition' to make sure I set the correct partition to active, and repeat both Bootrec commands, the result still the same. I then try to completely rebuilding the BCD as you suggested in other post: bcdedit /export C:\BCD_Backup c: cd boot attrib bcd -s -h -r ren c:\boot\bcd bcd.old bootrec /RebuildBcd But the result is still the same, blinking cursor on boot. I have no idea what else I can do, the boot folder and bootmgr is in the Win7 partition. Originally I have a hdd with 3 partitions, 2 primary and one logical. The first primary is winXP and second is win7, the logical partition is just some data. Now the winXP partition is gone and I can't boot into win7. Please suggest what to do. Thank you.

L Duderino
L Duderino

When I try to make windows 7 the active partition I get: "Virtual Disk Service Error: The specified partition type is not valid for this operation" Any ideas??? Really wanna get rid of XP installation. I also have a second HDD with just data on it, could that be related?

andrew.glenda
andrew.glenda

I like it but I want to remove a vista partition in the same manner, would that work? Or would I just change the active partition in disk management? Comments pretty please

ga.shepard
ga.shepard

Is there an article for those who dual boot Vista and Win7 and want to get rid of the Vista partition?

tjrobinson
tjrobinson

[edited post to place blame where it belongs--on me] When I read the prompts, it seemed like I was doing just the opposite than what I wanted to do, but I went ahead and followed the instructions verbatim. Big mistake. I deleted my Windows 7 boot and ended up booting straight into XP. I've since reimaged my system and corrected my mistake, but here's the important lesson. The directions made in the original article only apply if your hard drive(s) are set up exactly the same as in the article. When you delect a partition, you are doing just that. You must know which disk and partition XP is on, as well as which disk and partition Win7 is on, and act accordingly. My system was completely different than the system in the article! Stop and think, that's all I'm saying. Otherwise, this is a very good article.

estephen4
estephen4

I have been unable to get this to work having tried several times. I follow the instructions to the letter, checking and rechecking. All goes well untill restart when it pops up and says 'A disk read error occurred. Press ctrl-alt-del to restart'. After a restart the same thing occurs. I have to go back and restore for the system image. This has happened each and every time I have tried to follow these instructions.

Will-V-King
Will-V-King

If the two system are XP Home and XP Pro. Does the article till suit to that situation? I want remove XP Home (on the primary partition C which is active), and use the XP Pro (on the logical partition J). PS: I have 3 partitions on the computer. Can you sent me an email please? Thanks in advance. will-v-king@hotmail.com

winkpain
winkpain

Attempted Greg's procedure and got as far as the bootrec /fixboot command which returned a "incorrect parameter" error. I now have one partition with an unbootable W7 and a deleted XP partition. Can the existing W7 install be saved?

MPG187
MPG187

I am going to dual boot XP Tablet PC Edition with Windows 7 incase Windows 7 doesn't work with everything. I'm sure it has Pen support since in system properties there is a section for it, I know Vista had it because I seen a tablet running Vista. The thing I am worried about is on the side of the screen there are "buttons" you touch with the pen to rotate the screen, bring up and OSK and there's an HP one. Not sure if they would work in 7. They don't work in Ubuntu :(

Greg Shultz
Greg Shultz

...that you restore from your systme image and start over from scratch--only this time remove your external usb drive before you start. I know that sounds like a pretty extreme solution, but you will be much better off in the long run.

Greg Shultz
Greg Shultz

...for you to do is to create an image of the Windows 7 hard disk on optical disk or on an external hard disk, take the slower hard disks out of your computer, put the new fast one in and then restore from the back up image to the new hard disk. Whatever you do, don't reformat the current Windows XP or 7 hard disks until you have completed the restore operation and everything is working the way that you want. That way if anything goes wrong, you can just put the original hard disks back into your system and be back in business. You can use Windows 7's Backup and Restore - Create a System Image to make the image. Use the Create a system Repair disc, so that you can boot your system after you put in the new hard disk and then use the available tools to restore from the image. Good luck!

Greg Shultz
Greg Shultz

...I don't think that what you propose will cause any problems.

Greg Shultz
Greg Shultz

... doublecheck and make sure that you are copying the Boot folder and the bootmgr file, as shown in Figure C. They shouldn't be in use at this point... Try again and let me know what happens.

jre50
jre50

I had successfully migrated my laptop from an XP/Win7 dual boot configuration to just Win7 using Greg's documents and decided to try it yesterday on my desktop computer. My configuration was just as described in the article (XP on the first partition, Win7 on the second). When I tried to use Diskpart to set partition 2 as active I got the same error message (the specified partition type is not valid for this operation). I restored my system from backup and after reading through this entire thread I think I found the cause. I originally had XP on one Primary partition that encompassed the entire drive. I used a 3rd party partition manager software to shrink the partition to half the size of the drive and then created a new partition on the remaining portion. When I did this it created a "Logical" partition and not a "Primary" partition. Win7 was then installed on the "Logical" partition. When I deleted partition 1 and then tried to make partition 2 active Diskpart gave the partition type is not valid error because partition 2 was set to Logical and not Primary. Win7's Disk Management program will not allow you to set the second partition as Primary, but you can do that using the free Partition Wizard Home Edition. Once I set the second partition as Primary I no longer got the error in Diskpart.

Greg Shultz
Greg Shultz

...awry. Can't really say what happened, too many variables, but you can restore your image so that you can start again. Make sure that you read the instructions carefully...

dtphalen
dtphalen

Greg, I have the same problem with the active command on diskpart. all other commands up to that point worked fine. I get the same error: Virtual Disk Error: The specified partition type is not valid for this operation. I have just to partitions c:xp and z:win7. In the z:win7 z was given to me by the system. I copied and read all the info in many posts after post 55 and did not recogonize an actual fix for this problem. Denny

tjrobinson
tjrobinson

[Deleting this post because. Everything I want to say is in my original post]

Greg Shultz
Greg Shultz

...the procedure will follow the same basic steps; however, there will be some differences, so you will have to do some further investigations and carefully map out your strategy before you undertake the project. Good luck!

Greg Shultz
Greg Shultz

...you received an error at the Bootrec /fixboot command, but the error message would indicate a typo. However, not all is lost because the step at the beginning of the article for creating a system image was designed for precisely this type of situation. "That way, if anything out of the ordinary were to occur as you follow the steps in this procedure, you will be able to return to your current configuration." If the error was caused by a typo, then you should be able to simply repeat the boot from the DVD steps and reissue the Bootrec /fixboot ocommand. However, if that fails all you have to do restore the image and you can start all over... To do so, boot from the Windows 7 DVD and select the Repair Your Computer option. When you see the System Recovery Options dialog box, choose Windows Complete PC Restore and follow the onscreen instructions to restore the image. Once you do, you'll have a working dual-boot system again and can simply restart with the steps for dual-boot cleanup. Let me know how it works out.

Greg Shultz
Greg Shultz

...that the HP button it will work fine in Windows 7. If it doesn't, then you've still got XP up and running... Let me know what happens.

Jeff Parker
Jeff Parker

Hi Greg, many thanks. But when I go to do a system image (when running Win 7), it wants to backup both the Win7 and Win XP partitions. I presume then that the restore would put both on the destination disk?

mrdither
mrdither

I should have used the correct language. My XP hdd is currently plugged into SATA 1; Win 7 hdd into SATA 2. I intend to completely remove the XP hdd. I want to shut down my comp and plug SATA 1 into the Win 7 hdd. Do I need to enter the bios and tell it to boot off the Win 7 partition? Or, after moving the boot files to the Win 7 hdd, proceed to the Manipulating the partitions section procedures.

mrdither
mrdither

My XP partition in currently plugged into SATA 1; Win 7 into SATA 2. After completing these steps, do I plug SATA 1 into the Win 7 partition (I am going to use the XP partition for storage in another comp), reboot, enter the bios and tell it to boot off the Win 7 partition?

finmat
finmat

The only file that hasn't copied is BCD in Boot Folder. Is this vital? Don't think so ? is it more to do with dual booting? John

L Duderino
L Duderino

thanks, so I'll be able to make another system image of just the Win7 partition or will the image contain both partitions? Then format the entire HDD and recover the image of just Win7 with the XP partition gone and the space freed up?

Greg Shultz
Greg Shultz

... but the "Virtual Disk Error" signals some sort of error that is unrelated to the technique as I presented it. I wish that I could help but without knowing the full story, offering a solution is difficult.

Will-V-King
Will-V-King

It's not a problem already. I reinstalled the system. Change is good.

winkpain
winkpain

No typo. I have repeated your steps countless times with the same incorrect parameter result after the /fixboot command. Restoring the image and repeating produced the same. In addition a "bootrec /scanos" command returns a 0 on installed operating systems. I can view the partition in a DOS window, however, and see the files, Windows and all. Any ideas at all?

MPG187
MPG187

Didn't work in a vanilla install of Windows 7, but I just had to install the drivers. They were Wacom Tablet Drivers and I think I also needed the HP Quick Launch App. And yes I still have XP. I wanna see if I can get it working with Ubuntu, but I only have a 80 GB HD and triboot would be a tight squeeze. Maybe I should get another HD.

Greg Shultz
Greg Shultz

...on the SATA 2, you should be able to move the boot files and then just switch the Win 7 hdd into the SATA 1 conector. However, please make sure that you have Images of bith hard disks so that you can restore in case of a problem.

finmat
finmat

Tried it all including Safe Mode, copy from Vista partition closig it and pasting into Win 7. No joy. Always get message BCD open in System. Close and retry. Think I will do a cleanout and start from scratch with Win7. Will clear out a lot of clutter!

Greg Shultz
Greg Shultz

... in the Boot Manager folder are necessary. Try booting Windows XP into Safe Mode and then copy the Boot folder and the bootmgr file from the root of XP's drive C to the root of 7's partition.

Greg Shultz
Greg Shultz

...the image that you made before start. This is a pretty complex operation, so you need to be sure that you read all the instructions in the three articles in detail.

roger.denat
roger.denat

Thanks Denny (sorry I got your name wrong last time). Your explanation makes sense. I don't have partition magic on the computer, but I did download the Partition Wizard tool and will give it a try tonight. As you say, once the partition is marked primary, the rest should be a cake walk. Regards, Roger

dtphalen
dtphalen

Roger, as mentioned above I did not document my method as I thought I would not have to use it again, but I think I may be able to help. You cannot use microsofts "disk Management" tool, at least I could not find a way to make my 2nd partition (Win 7)a primary. Here's where I'm not sure which I used to do it but I think either will work as both of them allow you to make more than 1 partition primary. Norton's "Partition Magic" or as Greg mentioned "Partiton Wizard Home Edition v4.2.2 (Free). If you are like me and you had Norton's "Partition Magic" already on you computer try it first as I'm pretty sure thats what I used. You must do this while your in XP. The process will be very similar to that below in "PW". If you use "Partition Wizard" Just type in info to left in Google and you should be able to find the free edition there. Install Partition Wizard and run it and it will take you to the main screen. Right click on the partition you want to make primariy (the Win 7 partition), click on "modify", click on "make partition primary" and that should take care of it. Then just follow Greg's "Migrate to Windows 7 from an XP Dual boot configuration". When you are in "Command prompt" and then "Diskpart", and you get to Make the win7 partition "active" it should work this time. Good Luck, Denny

roger.denat
roger.denat

Dennis, How did you make the partition primary? The tools recommended did not do it for me (or perhaps I didn't dig deep enough to figure out how). Regards, Roger

Greg Shultz
Greg Shultz

...that everything worked out and that you are now enjoying a Windows 7 dual boot configuration!

dtphalen
dtphalen

Greg, First of all thanks for your interest and reply. My problem which I did not realize until I was doing some reading is that my partition was not of the primary type. Once I made it primary every thing went as you suggested. I also got rid of the unallocated partition per your write up. Thanks again, Dennis Phalen

winkpain
winkpain

However, before i gave up, yes, i did verify that the Boot folder and the bootmgr file were indeed copied and i attempted a BCD rebuild which returned a message of 0 operating systems installed leaving me still in the dark with nothing but a blinking cursor to light the way. I just ended up doing a reformat and clean install. I needed to move on. I apologize to anyone with the same problem who may have been following this post. I would, however, like to feel confident that this procedure works because i still need to do the same on my desktop machine...

Greg Shultz
Greg Shultz

...and verify that the Boot folder and the bootmgr file from the root the XP partition were indeed copied to the 7 partition? If so, you could try completely rebuilding the BCD: In this Microsoft Support article http://support.microsoft.com/kb/927392 a method of completely rebuilding the BCD is described as: bcdedit /export C:\BCD_Backup c: cd boot attrib bcd -s -h -r ren c:\boot\bcd bcd.old bootrec /RebuildBcd Go ahead and try this and let me know what happens.