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?

1
  • can you show us fdisk -l from within source VM? parted -l would also be nice Commented Aug 22, 2014 at 22:39

1 Answer 1

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.

3
  • 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? Commented Aug 22, 2014 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
    Commented Aug 23, 2014 at 0: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
    Commented Dec 26, 2014 at 4:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .