How do I copy a partition of an Image to a partition of a physical disk?
The proper command to dd a part of a raw file to a partition in your case is:

dd if=WINDOWS7.img of=/dev/disk0s4 skip=206848 bs=512 count=41527296


The bs in the dd command can be interpreted as an artificial block size of the input and the output "file". For historical and technical reasons the default block size of dd is 512 Byte.

The reason to use 512 (or an appropriate integer^2 multiple/divider) as bs is the block size of your image and the partition disk0s4 – which is either 512 or 4096.

The (logical) block size of disk0 can be calculated (even without knowing if fdisk works with 512 or 4096 Byte internally): 977105060 * 512 = 500 GB or 977105060 * 4096 = 4 TB. A 4 TB SSD still doesn't exist for MacBook Pro's therefore the block size has to be 512 byte. The same is valid for your img file.

Now you may take speed reasons into account: the bigger the bs is, the faster the image will be copied.

So one valid dd command in your case may be:

dd if=WINDOWS7.img of=/dev/disk0s4 skip=X bs=2 count=Y


Since bs is 2 Byte only, you have to modify skip (skips X blocks à bs of if) and count (Y blocks à bs are "written"). Since skip is 206848*512, X is 206848*512/2 and count is 41527296*512, Y is 41527296*512/2 and the above command is:

dd if=WINDOWS7.img of=/dev/disk0s4 skip=52953088 bs=2 count=10630987776


A quick test reveals:

dd if=/dev/zero of=~/Desktop/output.file bs=1 count=1048576
1048576 bytes transferred in 1.593527 secs (658022 bytes/sec)
dd if=/dev/zero of=~/Desktop/output.file bs=2 count=524288
1048576 bytes transferred in 0.800444 secs (1309993 bytes/sec)
dd if=/dev/zero of=~/Desktop/output.file bs=4 count=262144
1048576 bytes transferred in 0.384188 secs (2729331 bytes/sec)
dd if=/dev/zero of=~/Desktop/output.file bs=1024 count=1024
1048576 bytes transferred in 0.001932 secs (542700705 bytes/sec)


The larger bs is, the faster the dd command is executed.

BTW: The largest bs working for you is 1048576 (the greatest common divisor) because 105906176(=skip-size in Byte)/1048576=101 (and 21261975552(=count-size in Byte)/1048576=20277). 101 is prime!



So far all bs values are multiples of 2. If bs is uneven this may collide with the (block-)sizes of if/of. At least in your case if and of have even Byte sizes because they are multiples of 512.

Now it should be obvious why using bs=65535 fails: skip and count block numbers are determined by bs and not by the natural block size of your image or partition. A proper command may be 

dd if=WINDOWS7.img of=/dev/disk0s4 skip=1616.024... bs=65535 count=324436.950...


At least for me this fails because 1616.024... is an illegal numeric value. So one may assume that all numbers have to be integer values!

A bs of 65535 only works if the total size of if/of and any skip or seek "boundaries" are multiples of 65535 Byte.

If your dd command doesn't contain any skip/seek/count part you may use arbitrary bs sizes though.



Though the dd command at the beginning of answer will work, you probably won't be able to boot to the Windows To Go (or Windows Installer Ready-To-Go?) partition. The MBR of disk0 won't contain the necessary boot entry.