I have destination drive which I know is partitioned in 512b sectors. I want to transfer let's say 150b file with dd to this drive at a given destination, let's say start sector 2099200, and then to read exactly the same amount of bytes as the file size (150b) from the same location sector. I tried something like this:
sudo dd if=my.txt of=/dev/sdb obs=512 seek=2099199
sudo dd if=/dev/sdb of=my.txt obs=150 count=1 ibs=512 skip=2099199
It almost works but I can't make it transfer only 150b:
1+0 records in 3+1 records out 512 bytes (512 B) copied
What is wrong and how to do what I need? May be I get it wrong and some other solution would be better, but I need to be file system independent.