Как объединить vhdx и avhdx
Перейти к содержимому

Как объединить vhdx и avhdx

  • автор:

Merge Hyper-V Checkpoints (AVHDX to VHDX) easily!

Are you looking to merge checkpoints with virtual machines/VHDX files in Hyper-V? While it may seem straightforward to do it within the program, you might encounter errors along the way. But fear not! In this guide, we will show you how to manually merge checkpoints, skip errors, and even import AHVDX files from another system. So let’s dive in and learn how to merge checkpoints in Hyper-V.

What are Checkpoints in Hyper-V?

Checkpoints, also known as snapshots, are a feature in Hyper-V that allows you to capture the state of a virtual machine at a specific point in time. This feature is handy when you want to revert to a previous state or create backups of your virtual machines.

However, over time, these checkpoints can accumulate and take up valuable storage space. That’s why it’s essential to merge checkpoints with the original virtual hard disk (VHDX) files. Merging checkpoints allows you to consolidate changes made to the virtual machine and reduce the number of checkpoint files.

However, he may also find yourself in a situation where you need to merge AHVDX files into VHDX files without the need of hyper V because of some error or because you’re bringing virtual machines from another system. That’s the situation I found myself in and the reason that I need to merge AHVDX files because I had to recreate the virtual machine with just the hard drive.

Manual AHVDX Merge in Hyper-V

Navigation

Locate your checkpoints. These will be the same place as the VHDX (drive) file for your virtual machine. If you recreated a virtual machine using just this file, you’ve likely already seen these AHVDX files we’ll be merging.

When you’re in this folder, right click the pause bar at the very top and choose copy address.

Now open a powershell or terminal window.

In the Terminal or PowerShell, type the drive letter followed by a colon (e.g., “H:”) and press Enter. This will change the current directory to the specified drive.

Then, use the “cd” command followed by a space to change to the directory where your virtual hard drive files and checkpoints are located. Paste the copied address after “cd” to navigate to the correct folder.

Finding out information

To merge a checkpoint with the original virtual hard disk file, we first need to gather information about the checkpoint. Run the following command:

get-vhd -Path "path_to_checkpoint"

Replace “path_to_checkpoint” with the path of the checkpoint file you want to merge. Enclose the path in quotes if it contains spaces.

The command will provide information about the checkpoint file, including its type (differencing) and the paths of the checkpoint and parent drive.

Merge the Checkpoint with the Original Drive

Now that we have the necessary information, we can proceed to merge the checkpoint with the original virtual hard drive file. Use the following command:

merge-vhd -Path "path_to_checkpoint" -DestinationPath "path_to_original_drive"

Replace “path_to_checkpoint” with the path of the checkpoint file you want to merge and “path_to_original_drive” with the path of the original virtual hard drive file.

Make sure to enclose the paths in quotes if they contain spaces. Press Enter to initiate the merging process.

An important note, if instead of pointing to a dry, violet points to another checkpoint, you’ll need to follow the checkpoint chain, merging each checkpoint into the next until you finally merge into the drive file.

Handling Errors and Troubleshooting

During the merging process, you may encounter errors. If you see any error messages, carefully read through them to identify the cause. Common errors include files already in use or virtual machines running. In such cases, try closing any programs using the files or shutting down the virtual machine.

If errors persist, you can try rebooting your computer, as this often resolves issues related to file usage.

Verify the Merged Drive

Once the merging process is complete, you can verify the merged drive. You can either boot up the virtual machine or explore the drive as you usually would. You should now be able to access all the updated files within the merged drive.

Final Thoughts

Merging checkpoints in Hyper-V is a crucial step in managing your virtual machines effectively. By following the step-by-step guide provided in this article, you can merge checkpoints, skip errors, and even import AHVDX files from another system. Remember to always back up your files before performing any merging operations to avoid data loss.

Opening .avhdx file from Hyper V virtual machine

I have .vhdx and .avhdx files. First one is 4KB, 2nd 70GB, so its safe to assume that everything what i need is in 2nd file. How can i open it? I need to get one file which is saved on virtual machine hard drive.

asked May 29, 2020 at 19:18
Corporal Girrafe Corporal Girrafe
21 1 1 silver badge 2 2 bronze badges

2 Answers 2

U need merge .avhdx with destinationpath .vhdx with this command

tHIS IS AN EXAMPLE WITH VM = sirha82022 u need change text to ur VM name

  1. Open Powershell with administrator
  2. Put dir to VM direction example dir E:\VMACHINES2022\Virtual Hard Disks>
  3. put this command and apply ur VM name on this

Merge-VHD -Path «.\NAMEA_VHDX.avhdx» -DestinationPath «.\NAME_VM.avhd»

Merge-VHD -Path «.\sirha82022_7ECC6258-4ACF-43F6-8BB0-38572F29FA7C.avhdx» -DestinationPath «.\sirha82022.vhdx».

  1. Mount the .vhdx resultant

Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Simple script to merge AVHDX into VHDX files

TheGabeMan/Hyper-V-MergeAVHDX

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Go to file

Folders and files

Last commit message
Last commit date

Latest commit

History

View all files

Repository files navigation

Hyper-V-MergeAVHDX

Simple script to merge AVHDX into VHDX files

Shutdown the VM, then let the script merge all the AVHDX files into the VHDX. Be sure to reconfigure the VM to point to the VHDX instead of the AVHDX. I’ve had most success when removing the disks, save the VM, then edit the VM again and re-add the disks.

Can I combine vhdx and avhdx file to save disk space?

I create a VM on my Windows 10 machine. Originally, it only has 1 vhdx file for my virtual hard disk. But now, it creates another file *.avhdx for the disk. Is there a way to combine them? the vhdx file is 255GB and the avhdx is 139 GB. Can you please tell me how can I safely remove the avhdx file to save space?

asked May 18, 2016 at 17:36
3,673 14 14 gold badges 40 40 silver badges 40 40 bronze badges

avhdx is a file for the snapshot feature within Hyper-V, even if you could merge the two files, the amount of storage used woudln’t change. If you don’t care about the snapshots then delete them.

May 18, 2016 at 17:45

In My VM, I see my C: is 300GB. but when I go to host , I add vhdx and avhdx file, they are 267gb+145GB , that is much more than 300GB

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *