Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

It's quite easy to backup a real drive to VHD, e.g. with Sysinternal's Disk2VHD on XP or with Windows Image Backup on Windows 7. But how do I copy that file back?

It's possible by booting a recovery CD or the Windows installation DVD. But can it also be done from a running operation system? Can it be scripted?

We want to clone a drive to another drive daily using this.

share|improve this question
1  
You just want to use the VHD as an exchange format? Without ever running it in a virtual machine? Then use imaging software like Clonezilla, Norton Ghost or Acronis True Image. –  mailq Aug 2 '11 at 15:57
    
Microsoft chose VHD as it's image format for any kind of activity: They use it for backups and in Win 7 you can mount them directly. The question how to RESTORE a backup is surely okay! –  Christian Aug 4 '11 at 6:35

4 Answers 4

There are at least two similar questions that got accepted answers:

http://superuser.com/questions/40294/copying-a-vhd-to-a-physical-disk

Vdisk (vhd) to physical

But you can't do it from a running OS.

It would be a hard thing to script this. Following the Linux dd aproach one could say that everything is possible. Boot from PXE, locate the VHD, locate the physical disc, dd from V to P, when finished reboot.

share|improve this answer

It is possible to use Virtualbox to attach phisical device as virtual device inside the VM

win method

VBoxManage internalcommands createrawvmdk -filename "C:\Users\vhudson\VirtualBox VMs\usb.vmdk" -rawdisk \\.\PhysicalDrive1

linux method

VBoxManage internalcommands createrawvmdk -filename usb.vmdk -rawdisk /deb/sdb

Adding also additional iso as live cd something like hirens boot or some linux rescue image. It is possible to do image copying from one virtual device to physical device that is virtually present inside the virtual machine.

share|improve this answer

Not aware of a free way but I know one of Acronis's products ('True Image'?) can do this.

share|improve this answer

qemu-img command which is part of the QEMU emulator package supports VHD according to its manual page (though I have never needed this myself). I do not know if this works on Windows but on Linux at least it does (I suppose it does not matter as you did not tag your desired platform?).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.