I'm trying to do an 'advanced case' of cloning.
There is a pipe writing to a block device, at the end of which there is a partition that should not be touched. I know where this partition starts. In this case I want to override the partition table.
For the sake of simpilicty the pipe starts with
dd if=myfile > /dev/sda
I could do something like
dd if=myfile | dd bs=1B count=startofmypartition-~1000000 > /dev/sda
But are there any better ways to do that and are there any drawbacks to this method?
pv has a size option, but it states that it is only used to calcualte the ETA, so I'm not sure if this will work:
(from the manpage:)
-s SIZE, --size SIZE Assume the total amount of data to be transferred is SIZE bytes when calculating percentages and ETAs. The same suffixes of "k", "m" etc can be used as with -L.
I know that there will be more write operations, but it should turn out to be the same data on the disk using the same amount space - as long it's not a tape drive.