User Tools

Site Tools


clone_windows_partition

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
clone_windows_partition [2025/07/26 13:52] – [As to the details for changing the Guid of the copyied partition.] phillipclone_windows_partition [2025/08/06 16:09] (current) – [The process in a nutshell] phillip
Line 1: Line 1:
 ====== Clone Windows Partition to same disk ====== ====== Clone Windows Partition to same disk ======
  
-Some of the knowledge of this page is derived from gemini.google.com. Experience says… Sometimes you need to test and/or verify a gemini answer+Some of the knowledge of this page is derived from gemini.google.com. Experience says… Sometimes you need to test and/or verify a gemini answer.
  
 ===== Why? ===== ===== Why? =====
Line 10: Line 10:
  
 There is a set of things that need to be done after one clones the Windows partition to another partition on the same disk, that will allow the copy/clone to be bootable. That set includes….. 1) Change the "guid" of the copied partition. 2) In the registry of the copy/clone, you need to "adjust" references to the old "guid". The registry key involved is in HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices, on the //**cloned/copied**//  partition. //**Do NOT**//  change the keys on the //**original**//  partition. The key with the name "DosDevices\C:" should be renamed, removed or deleted. Renaming the key to "DosDevices\"An unused drive letter":" should be "good enough". There is a set of things that need to be done after one clones the Windows partition to another partition on the same disk, that will allow the copy/clone to be bootable. That set includes….. 1) Change the "guid" of the copied partition. 2) In the registry of the copy/clone, you need to "adjust" references to the old "guid". The registry key involved is in HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices, on the //**cloned/copied**//  partition. //**Do NOT**//  change the keys on the //**original**//  partition. The key with the name "DosDevices\C:" should be renamed, removed or deleted. Renaming the key to "DosDevices\"An unused drive letter":" should be "good enough".
- 
- 
 ==== The process in a nutshell ==== ==== The process in a nutshell ====
  
 1) Create space for the clone. 1) Create space for the clone.
  
-Tool. Windows Disk Management. Windows Disk Management requires invocation from an administrative account. Use this tool to "shrink" the Windows (C drive) partition to something slightly larger than the space used in the present Windows partition. 20 gigabytes more of the space presently consumed by the Windows partition will do. If the present space consumed in the Windows partition is approaching 50% of the size of the Windows partition, this process is probably not a good idea for the hard drive in your computer. Solution… Get a bigger storage device and clone the present storage device to the new/larger one.  Install the new/bigger device and keep the smaller one as a backup.+Tool. Windows Disk Management. Windows Disk Management requires invocation from an administrative account. Use this tool to "shrink" the Windows (C drive) partition to something slightly larger than the space used in the present Windows partition. 20 gigabytes more of the space presently consumed by the Windows partition will do. If the present space consumed in the Windows partition is approaching 50% of the size of the Windows partition, this process is probably not a good idea for the hard drive in your computer. Solution… Get a bigger storage device and clone the present storage device to the new/larger one. Install the new/bigger device and keep the smaller one as a backup.
  
 2) Clone/copy the partition to the empty space. 2) Clone/copy the partition to the empty space.
 + <font 14px/inherit;;inherit;;inherit>Experience says...  Make sure that "//**chkdsk**// c:" identifies there are NO errors on the  partition you are cloning.   Cloning tools typically "//**fail to complete**//" if "//**chkdsk**//" indicates there are issues with the partition or disk.</font>
  
 Tool options… For ease of use and automated handling of resizing when copying to a smaller partition (as long as the data fits), **AOMEI Partition Assistant Standard**, **MiniTool Partition Wizard Free**, and **EaseUS Partition Master Free Edition** are generally the best choices for Windows users. They offer a graphical interface and "intelligent cloning" features that simplify the process. Tool options… For ease of use and automated handling of resizing when copying to a smaller partition (as long as the data fits), **AOMEI Partition Assistant Standard**, **MiniTool Partition Wizard Free**, and **EaseUS Partition Master Free Edition** are generally the best choices for Windows users. They offer a graphical interface and "intelligent cloning" features that simplify the process.
Line 28: Line 27:
 Why? Windows can be confused if partitions have the "same" guid. Cloning a partition usually creates a partition with the SAME guid as the original. Why? Windows can be confused if partitions have the "same" guid. Cloning a partition usually creates a partition with the SAME guid as the original.
  
-Tools to use… sgdisk64. This tool is used to view and/or verify the partition guids of the Windows partition and its clone/copy are the same. After confirming the guids are the same, sgdisk64 will be used to change the partition guid of the clone/copy.+Tool to use… sgdisk64. This tool is used to view or change the //**partition unique ** ////**gui**// of the Windows partition. The //**partition unique guid **//  will probably be the same after you clone a partition. After confirming the guids are the same, sgdisk64 will be used to change the //**partition unique guid**//  of the clone/copy.
  
 4) Make the new partition bootable. 4) Make the new partition bootable.
  
-Tool options… Windows "bcdboot" to create a new boot option. "msconfig.exe" to adjust boot options. There is a "boot" tab in the msconfig.exe application that provides the ability to "fine tune" boot options and the selection of the boot partition.+Tool options… Windows "bcdboot" to create a new boot option. "msconfig.exe" to adjust boot options. There is a "boot" tab in the msconfig.exe application that provides the ability to "fine tune" boot options and the selection of the //**default**//  boot partition. If you want to understand bcdboot, gemini.google.com might be helpful. Ask gemini.google.com this question… " //As to Windows bcdboot. Please show me the bcdboot options for adding a cloned copy of the windows partition to the windows boot menu//." The simplist form would be "bcdboot F:\Windows", where F: is the drive letter that identifies the cloned copy of windows.
  
  
-==== As to the details for changing the Guid of the copied partition. ====+=== As to the details for changing the Guid of the copied partition. ===
  
 This process is possibly the "most risky". Why? If you do not understand or "make a mistake", the integrity of the storage device ( C drive) is at risk. If you change the guid of the wrong(original) partition, that is NOT GOOD!. This process is possibly the "most risky". Why? If you do not understand or "make a mistake", the integrity of the storage device ( C drive) is at risk. If you change the guid of the wrong(original) partition, that is NOT GOOD!.
  
-The tool for changing the guid of a paritition was identified by one of my questions to gemini. The tool is sgdisk64.exe which is part of the gptfdisk project from [[https://sourceforge.net/projects/gptfdisk/|https://sourceforge.net/projects/gptfdisk/]] . You need to download the zip file from this site and extract the contents to a directory. The program you will use to change the guid of the copied partition is sgdisk64.exe. The files extracted from the zip file includes documentation and references to books that detail how to use sgdisk64, cgdisk64 and gdisk64. All of these tools are programs executed from the command prompt.+The tool for changing the guid of a paritition was identified by one of my questions to gemini. The tool is sgdisk64.exe which is part of the gptfdisk project from [[https://sourceforge.net/projects/gptfdisk/|https://sourceforge.net/projects/gptfdisk/]] . You need to download the zip file from this site and extract the contents to a directory. The program you will use to change the guid of the copied partition is sgdisk64.exe. The files extracted from the zip file includes documentation and references to books that detail how to use sgdisk64, cgdisk64 and gdisk64. All of these tools are programs executed from the command prompt.
  
 +=== Example.. Changing the Partition Unique Guid of partition 1 on disk 4. ===
  
-=== Example… "sgdisk64 -p 0:" Will print the partition table of disk 0. Note that disk numbers start with 0. ===+=== Step 1. Observe the partition table of disk 4. ===
  
-C:\Users\Phillip\Downloads\gdisk-windows-1.0.10>sgdisk64 -p 0:\\ +**C:\Users\Phillip\Downloads\gdisk-windows-1.0.10>sgdisk64 -p 4:** \\ 
-Disk 0:: 976773168 sectors, 465.GiB\\+Disk 4:: 122880000 sectors, 58.GiB\\
 Sector size (logical): 512 bytes\\ Sector size (logical): 512 bytes\\
-Disk identifier (GUID): B2B97D7C-3DE0-43B2-A78A-0F00CB879D17\\+Disk identifier (GUID): 0E8C7400-FCC0-03B7-001D-A30330FFED00\\
 Partition table holds up to 128 entries\\ Partition table holds up to 128 entries\\
 Main partition table begins at sector 2 and ends at sector 33\\ Main partition table begins at sector 2 and ends at sector 33\\
-First usable sector is 34, last usable sector is 976773134\\ +First usable sector is 34, last usable sector is 122879966\\ 
-Partitions will be aligned on 8-sector boundaries\\ +Partitions will be aligned on 2048-sector boundaries\\ 
-Total free space is 4077 sectors (2.0 MiB)+Total free space is 4029 sectors (2.0 MiB) ===
  
 Number Start (sector) End (sector) Size Code Name\\ Number Start (sector) End (sector) Size Code Name\\
-34 262177 128.0 MiB 0C01\\ +2048 11063295 5.3 GiB 0700 Basic data partition\\ 
-264192 976771071 465.GiB 0700 Basic data partition+11063296 48951295 18.GiB 0700 Basic data partition\\ 
 +3 48951296 122877951 35.3 GiB 0700 Basic data partition 
 + 
 +=== Step 2: Observe the present value of the Partition Unique Guid for partition 1. === 
 + 
 +**C:\Users\Phillip\Downloads\gdisk-windows-1.0.10>sgdisk64 -i 1 4:** \\ 
 +Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)\\ 
 +//**Partition unique GUID: 50065F70-FE60-01DB-B82B-032830FFED00** // \\ 
 +First sector: 2048 (at 1024.0 KiB)\\ 
 +Last sector: 11063295 (at 5.3 GiB)\\ 
 +Partition size: 11061248 sectors (5.3 GiB)\\ 
 +Attribute flags: 0000000000000000\\ 
 +Partition name: 'Basic data partition' 
 + 
 +=== Step 3: Change the Partition Unique Guid of partition 1 on disk 4. === 
 + 
 +**C:\Users\Phillip\Downloads\gdisk-windows-1.0.10>sgdisk64 -u 1:R 4:** \\ 
 +Disk synchronization succeeded! The computer should now use the new\\ 
 +partition table.\\ 
 +The operation has completed successfully.
  
-=== Example...  "sgdisk64 -i 2 0:" Will print the details of partition on disk 0.  Note that partition numbers start with 1. ===+=== Step 4Verify the Partition Unique Guid of partition on disk 4 has changed. ===
  
-C:\Users\Phillip\Downloads\gdisk-windows-1.0.10>sgdisk64 -i 2 0:\\+**C:\Users\Phillip\Downloads\gdisk-windows-1.0.10>sgdisk64 -i 1 4:** \\
 Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)\\ Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)\\
-Partition unique GUID: 4DECABA2-CF1D-4A05-BAC4-4DB66A8D628E\\ +//**Partition unique GUID: C177F3D2-3275-4126-BEC0-348FF6EF6CE9** // \\ 
-First sector: 264192 (at 129.0 MiB)\\ +First sector: 2048 (at 1024.0 KiB)\\ 
-Last sector: 976771071 (at 465.GiB)\\ +Last sector: 11063295 (at 5.GiB)\\ 
-Partition size: 976506880 sectors (465.GiB)\\+Partition size: 11061248 sectors (5.GiB)\\
 Attribute flags: 0000000000000000\\ Attribute flags: 0000000000000000\\
 Partition name: 'Basic data partition' Partition name: 'Basic data partition'
  
  
/home/sctxcompclubora/sctxcompclub.net/data/attic/clone_windows_partition.1753537943.txt.gz · Last modified: 2025/07/26 13:52 by phillip