Se você usar o argumento conv=notrunc
, poderá substituir apenas os primeiros quantos bytes.
por exemplo. dd conv=notrunc if=small.img of=large.img
root@debian:~/ddtest# dd if=/dev/zero of=file1.img bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 1.14556 s, 9.2 MB/s
root@debian:~/ddtest# dd if=/dev/urandom of=file2.img bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.207185 s, 5.1 MB/s
root@debian:~/ddtest# head file1.img
<< Blank space here as it's all Zeroes >>
root@debian:~/ddtest# dd conv=notrunc if=file2.img of=file1.img
2048+0 records in
2048+0 records out
1048576 bytes (1.0 MB) copied, 0.00468016 s, 224 MB/s
root@debian:~/ddtest# head file1.img
^�v�y�ے!� E�91���� << SNIP Random garbage >>
root@debian:~/ddtest#