Consolidating Disk Partitions in a Windows XP to Windows 7 Migration

If your Windows XP systems have multiple disk partitions and you are migrating them to Windows 7, you may have a requirement to combine all partitions into one so Windows 7 ends up on a sufficiently large partition.  In a Refresh scenario, where the same Windows XP system will end up with Windows 7, this can be a challenging requirement if you must preserve the user data.

Fortunately, this Windows 7 deployment scenario is possible if you are using System Center Configuration Manager (SCCM) 2007.  In a nutshell, SCCM can automate the following steps during deployment:

  1. Save the user data
  2. Delete the extra partition(s)
  3. Extend the primary partition where Windows XP is installed
  4. Install Windows 7 on the extended partition
  5. Restore the user data

In an SCCM task sequence, the “Capture User State” step is used to save the user data.  If the partition being deleted contains user data, you must save the state data to the State Migration Point (instead of using the USMT 4 hardlink feature which leaves the data on the local drive).  When integrating MDT 2010 with SCCM 2007, hardlinks will be used by default but you can force to use the State Migration Point by disabling the Determine Local or Remote User State step.

Deleting the extra partition(s) can be accomplished by running diskpart commands in the task sequence.  For example, if you have to delete one extra partition on disk 0, the diskpart commands would be


You can automate the diskpart commands by entering them in a text file (such as myScript.txt) that you would call with the /s parameter of the diskpart command.  This is an example:

Diskpart /s myScript.txt

Of course, before you use a script like this in a deployment, you would have to first test the diskpart commands manually on test systems that are configured like your production systems to ensure that you obtain the desired results.

You would then run the diskpart command, calling the script, from the task sequence.  You can use the Run Command Line step to run the command.  However, we must find a way to make the script file available to the task sequence.  One way is to include the file in an SCCM package and then include that package in the Run Command Line step, as illustrated below.

You can place the WME – Fix Partitions step in the Refresh Only group:

Then the Apply Operating System Image step should be configured to use a unattend.xml file that sets the ExtendOSPartition variable in the specialize phase to True.

This is the bottom section of the Apply Operating System Image step:

If Extending the Partition Fails

Extending a disk is sometimes not possible.   A couple reasons for this limitation are detailed in this Microsoft article about diskpart.  Depending on your specific disk configuration, it may be possible to use the Format and Partition Disk step after the diskpart step to repartition the disk using all the available unallocated space.  This would allow you to end up with one partition, where Windows 7 would be installed.  The step should run while in Windows PE in the Refresh Only group (which runs after saving the user state).  You would need to first test the deployment to a test machine to ensure that it works as expected in your environment.

These are the properties of the Format and Partition step:

And these are the settings of the OSDisk (Primary) volume:

These format and partition settings may differ depending on the disk configuration of your systems.



Contact Us

On Key

More Posts

Mastering Azure AD Connect - A Comprehensive Guide by WME
Active Directory

Mastering Azure AD Connect – A Comprehensive Guide

Modern businesses are fast moving toward cloud-based infrastructure. In fact, cloud-based business is not just a trend anymore but a strategic necessity. Microsoft’s Azure Active Directory (Azure AD) has become a frontrunner in this domain. It

Read More »
Security Best Practices in SharePoint
Office 365

Security Best Practices in SharePoint

Microsoft SharePoint is an online collaboration platform that integrates with Microsoft Office. You can use it to store, organize, share, and access information online. SharePoint enables collaboration and content management and ultimately allows your teams to

Read More »
The Ultimate Guide to Microsoft Intune - Article by WME
Active Directory

The Ultimate Guide to Microsoft Intune

The corporate world is evolving fast. And with that, mobile devices are spreading everywhere. As we venture into the year 2024, they have already claimed a substantial 55% share of the total corporate device ecosystem. You

Read More »
Protecting Microsoft 365 from on-Premises Attacks
Cloud Security

How to Protect Microsoft 365 from On-Premises Attacks?

Microsoft 365 is diverse enough to enrich the capabilities of many types of private businesses. It complements users, applications, networks, devices, and whatnot. However, Microsoft 365 cybersecurity is often compromised and there are countless ways that

Read More »
Be assured of everything

Get WME Services

Stay ahead of the competition with our Professional IT offerings.