Page 1 of 1

how to create an image from a HD

Posted: 23. Jan 2014, 11:43
by traeumer
Hi,

i had to remove a HD from a Laptop. The HD is formatted with NTFS, two partitions, and running Windows XP.
Now I want to create a image file to use with a virtualbox ( maybe vmware player also) VM.
The original HD should remain unchanged.

So far I have found instructions how to use the HD:

Code: Select all

sudo VBoxManage internalcommands createrawvmdk -filename /Volumes/<PATH>/xp.vmdk -rawdisk /dev/disk3

sudo VBoxManage storageattach xp1 --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /Volumes/<PATH>/xp.vmdk

sudo /Applications/VirtualBox.app/Contents/MacOS/VirtualBox
 
or tools to create the imgage under windows - but I need to create the image from the HD on my Mac leaving the HD untouched.


Any help appreciated

Re: how to create an image from a HD

Posted: 23. Jan 2014, 12:36
by mpack
That command doesn't image the disk, it creates a raw-access wrapper around the physical disk. I really wouldn't recommend that, as there's danger that the host and guest will try to access it at the same time, and corrupt the disk.

Better would be to image the disk to any format supported by VirtualBox (i.e. VDI, VMDK, VHD - in that order of preference). There are a number of tools around which can do a good job of this task, producing a compacted image file. There are further tools that will do a half-assed but working job of it, producing a full size disk image that you should compact manually. On a Windows host I would image the disk using Disk2VHD then convert VHD to VDI using VBoxManage or CloneVDI. On a Mac - I'll leave recommendations to a Mac user.

Re: how to create an image from a HD

Posted: 23. Jan 2014, 13:43
by traeumer
thanks for your reply. I know that my commands do not image the disk - I justed wanted to show that I have thought about the problem, before just asking a question :wink: But I've read the warnings in the manual too.

So, waiting for the Mac user replying.

Re: how to create an image from a HD

Posted: 23. Jan 2014, 14:27
by mpack
If the drive is in an external caddy, which I'm assuming it is, can't you just take it to a Windows PC and run Disk2VHD on it? I doubt that the Mac has anything simpler.

Re: how to create an image from a HD

Posted: 23. Jan 2014, 19:05
by socratis
traeumer wrote:So, waiting for the Mac user replying.
I once had to do the same thing to an old NT4 system. I used a WinXP (maybe Win7) machine, where I mounted the external HD via USB (1.0), run Disk2VHD and saved the result in a read-write shared folder. Worked like a charm. The VM built around said drive is still running without an issue...