Copying the tail end of a drive using dd

twocell

Member
May 12, 2010
59
0
6
I'm trying to work out a method of using cygwin dd and shadow copy to create an image of a live 2003 server for p2v conversion. Shadow copy only gives us partition data, so the image isn't bootable. So my idea is this:

1) Use dd to copy the first 32k of the actual boot disk.
2) Use dd to copy the C: shadow partition.
3) Stitch them together.

This is enough to get a booting system, but it's incomplete. The last 8 meg on a windows disk is reserved for dynamic disk metadata. So if you use simple disks (and never intend to use dynamic disks) you are fine. However if you are converting a system with dynamic disks you have a problem. So the logical solution is to grab the last 8 meg from the physical using dd and then stitch it to the end of the file. But for some infuriating reason I can't get it to work. I've been trying things like:

dd if=/dev/sda bs=1 seek=400077331408 of=tail.raw

The partition size + the 32k header is 400077331408 bytes. I am telling dd to skip 400077331408 one byte blocks then start it's copy. When I hexedit the file ... it's all zeroes, definitely not my disk. It also keeps transferring way past the 8 meg that I think is left at the end of my drive.

I've tried a lot of different skip/seek combinations. Can someone please correct my syntax? Is there a better tool than dd to slice off the end of the drive? Hopefully one that comes with Cygwin?
 
I'm trying to work out a method of using cygwin dd and shadow copy to create an image of a live 2003 server for p2v conversion. Shadow copy only gives us partition data, so the image isn't bootable. So my idea is this:

1) Use dd to copy the first 32k of the actual boot disk.
2) Use dd to copy the C: shadow partition.
3) Stitch them together.

This is enough to get a booting system, but it's incomplete. The last 8 meg on a windows disk is reserved for dynamic disk metadata. So if you use simple disks (and never intend to use dynamic disks) you are fine. However if you are converting a system with dynamic disks you have a problem. So the logical solution is to grab the last 8 meg from the physical using dd and then stitch it to the end of the file. But for some infuriating reason I can't get it to work. I've been trying things like:

dd if=/dev/sda bs=1 seek=400077331408 of=tail.raw

The partition size + the 32k header is 400077331408 bytes. I am telling dd to skip 400077331408 one byte blocks then start it's copy. When I hexedit the file ... it's all zeroes, definitely not my disk. It also keeps transferring way past the 8 meg that I think is left at the end of my drive.

I've tried a lot of different skip/seek combinations. Can someone please correct my syntax? Is there a better tool than dd to slice off the end of the drive? Hopefully one that comes with Cygwin?
Hi,
man dd says:
seek=BLOCKS
skip BLOCKS obs-sized blocks at start of output

skip=BLOCKS
skip BLOCKS ibs-sized blocks at start of input

Have you tried
dd if=/dev/sda bs=1 seek=400077331408 skip=400077331408 of=tail.raw ?

EDIT - sorry i read the post again and see, that you only want the end after the partition.
EDIT2 - windows use the space after the partition? How works this, if the partition fill the whole drive? Or need you only the last 8M from the partition 400077331408-8M?
Udo
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!