0

I'm attempting to copy the disk of a working headless virtualbox VM (VM1) on one server to a new VM (VM2) on a vCloud server. I don't have access to the host of VM2. The OS is Windows Server 2003 (32-bit)

  1. I start both VMs with a live Knoppix image.
  2. I run 'nc -l | dd of=/dev/sda bs=512' on VM2
  3. I run 'dd if=/dev/sda bs=512 | nc ' on VM1

I previously did this with another windows VM and it worked fine.

VM1 has a disk of size ~70GB (verified with fdisk); however, the amount of data dd reports read/written is ~139GB.

Of course the target machine doesn't work properly. I get a Windows splash screen, then blue error screen with general 'system not working' information.

I'm at a loss what could cause this. Any ideas?

Kenster
  • 2,082
  • 16
  • 15
JivanAmara
  • 171
  • 1
  • 6

1 Answers1

0

My guess is that the source files are sparsely allocated (i.e. physical size < visible size) with "holes" in the data space. If you use dd, it will return zeros for the currently unallocated blocks in the file, thus the resulting output will be FAR larger than what your source file is.

mdpc
  • 11,698
  • 28
  • 51
  • 65
  • 1
    Doesn't make sense, because 1) he is reading data from within VM, 2) data is doubled: 70->140, how could zeros do that? – Jakov Sosic Aug 22 '14 at 22:37
  • A sparce situation takes up less space because blocks that never were in use are not allocated. when you do logical access via dd, ZEROs are added where unallocated space was present. The result is NOT sparce but a fully allocated file with the ZERO blocks where the unallocated space was. – mdpc Aug 23 '14 at 00:58
  • Reading the disk size from inside the VM shows 70GB of space. This doesn't change based on how sparsely files are allocated or how much of the disk is used. – JivanAmara Dec 26 '14 at 04:44