5

I'm using dd (under cygwin) to copy a shadow image of a disk in windows. Shadow copy will only give me a partion, so what I am doing is:

1) using dd to grab the disk header (32k on Win2003)
2) using dd to copy the shadow partition
3) using dd to copy the end of of the disk (8 meg reserved on Win2003)
4) stitch them all together and boot on KVM

I need the exact size of all the partitions and non partitioned space on this windows drive. Unfortunately most windows disk tools seem to fudge the numbers a bit, or at least give me a different size than Linux does. I could guess like this 32k + partition size + 8M, but I want to double check. If I make a mistake I could lose data.

This is on a remote & live Windows 2003 server so no offline solutions will be helpful. Latest cygwin is installed.

ᄂ ᄀ
  • 189
  • 2
  • 12
Antonius Bloch
  • 4,680
  • 6
  • 29
  • 41
  • 1
    I've actually solved the original disk imaging problem, but I never did figure out how to get an accurate byte size of a windows disk (the whole disk not partitions). This can't be that difficult ... – Antonius Bloch Feb 01 '11 at 19:59
  • I'd also like to add that I don't think the value shown in "My Computer>Disk>Disk Properties" is totally accurate. When I imaged a Windows 2003 machine I got a raw disk image of 73274490880 bytes but disk properties reports 73262534656. – Antonius Bloch Feb 01 '11 at 20:33
  • The plot thickens though: disk properties in windows = 73262534656, wmic = 73270794240, disk image on linux (ls -la) = 73274490880, wmic on virtual machine created from disk image = 73270794240. My theory is that Windows doesn't report on the empty space it reserves at the end of the disk. – Antonius Bloch Feb 01 '11 at 21:02

3 Answers3

8

Have you tried checking WMI for accurate values? You can query common aliases through the wmic command:

C:\>wmic partition get name,bootable,size,type
C:\>wmic diskdrive get size,status,TotalCylinders,TotalSectors,SCSIPort,SCSITargetId,model
beans
  • 1,580
  • 13
  • 16
2

wmic diskdrive : for physical size
wmic logicaldisk : for you know

tony roth
  • 3,884
  • 18
  • 14
0

Not exactly an answer, but you could use disk2vhd, then convert it for KVM using qemu-img convert -f vpc -O qcow server.vhd server.qcow command.

Chris S
  • 77,945
  • 11
  • 124
  • 216