Differencing VMDK Drives Created from Parent Physical Drive? How to Merge?
Posted: 8. Jul 2022, 17:59
Hi there, I'm in a situation that no web searching has brought me an appropriate result for.
Context:
I set up my web server to connect to a physical drive by following a tutorial that directed me to run. This worked great after I found my drive number using
Little did I know that the files I started adding to the physical drive were not in fact being added to the drive itself, but to a new vmdk file in the server's Snapshots folder instead! This vmdk file was created only a month after I created the raw physical drive vmdk, but since it seamlessly overlays within the guest OS, I had no idea. Flash forward to a power failure screwing up my guest OS, and I want to access the files from the physical drive from a different computer, where I find that I don't have any of the new files I had added over the past 6 months.
I searched around and that's when I noticed the snapshot files in the Virtual Media Manager labeled Type (Format) "Differencing (VMDK)" when I hover over them: Sure enough, my plan of using the external hard drive to store the files so my main hard drive didn't get filled up did not work as I had intended, and all my files and changes over the last 6 months are trapped in those UUID-labeled VMDK files instead.
Question:
How can I merge these snapshot files back onto the original physical drive? And how can I prevent Virtualbox from using snapshot files instead of the physical drive in the future?
I found this tutorial that uses a VMWare tool (www [dot] ubackup [dot] com/enterprise-backup/merge-vmdk-files [dot] html), but it appears to just merge into a new VMDK file instead of actually overwriting an existing one. And my issue goes further because I want that merged result back on the actual hard drive. Also, when I ran this
I got this:
Any help with this would be very much appreciated!
Context:
I set up my web server to connect to a physical drive by following a tutorial that directed me to run
Code: Select all
VBoxManage internalcommands createrawvmdk -filename "C:\Users\<user_name>\VirtualBox VMs\<VM_folder_name>file_name.vmdk" -rawdisk \\.\PhysicalDrive#diskpartand then
list diskand offlined the disk, and I used it for about 6 months in my guest Ubuntu 20.04 VM without any trouble.
Little did I know that the files I started adding to the physical drive were not in fact being added to the drive itself, but to a new vmdk file in the server's Snapshots folder instead! This vmdk file was created only a month after I created the raw physical drive vmdk, but since it seamlessly overlays within the guest OS, I had no idea. Flash forward to a power failure screwing up my guest OS, and I want to access the files from the physical drive from a different computer, where I find that I don't have any of the new files I had added over the past 6 months.
I searched around and that's when I noticed the snapshot files in the Virtual Media Manager labeled Type (Format) "Differencing (VMDK)" when I hover over them: Sure enough, my plan of using the external hard drive to store the files so my main hard drive didn't get filled up did not work as I had intended, and all my files and changes over the last 6 months are trapped in those UUID-labeled VMDK files instead.
Question:
How can I merge these snapshot files back onto the original physical drive? And how can I prevent Virtualbox from using snapshot files instead of the physical drive in the future?
I found this tutorial that uses a VMWare tool (www [dot] ubackup [dot] com/enterprise-backup/merge-vmdk-files [dot] html), but it appears to just merge into a new VMDK file instead of actually overwriting an existing one. And my issue goes further because I want that merged result back on the actual hard drive. Also, when I ran this
Code: Select all
.\vmware-vdiskmanager.exe -r "D:\Robbie\Virtual Machines\nuevo2\Snapshots - Copy\PhysicalDrive3.vmdk" -t 0 "D:\Robbie\Virtual Machines\nuevo2\Snapshots - Copy\merge\PhysicalDrive3.vmdk"Creating disk 'D:\Robbie\Virtual Machines\nuevo2\Snapshots - Copy\merge\PhysicalDrive3.vmdk' Failed to convert disk: The specified file is not a virtual disk (0x3ebf).Further context: I don't know what I'm doing, so I copied the raw vmdk file PhysicalDrive3.vmdk to the Snapshots folder (a copy, as you can see above) and named the snapshot vmdk files as PhysicalDrive3-0001.vmdk, PhysicalDrive3-0002.vmdk, and PhysicalDrive3-0003.vmdk because it seemed like incremental numbers were necessary or something, but I really don't know.
Any help with this would be very much appreciated!