Linux – what is the difference between seek and skip in dd command

ddhard-disklinux

I am trying to read from the disk and wanted to dd command to issue every request random and check for the latency of the disk for the read operation I have used seek and skip both will that work ?

dd if=/dev/rdsk/c2t5000CCA0284F36A4d0 skip=10  of=/dev/null bs=4k count=1024000
1024000+0 records in
1024000+0 records out
4194304000 bytes (4.2 GB) copied, 51.0287 s, 82.2 MB/s


dd if=/dev/rdsk/c2t5000CCA0284F36A4d0  seek=10  of=/dev/null bs=4k count=1024000
1024000+0 records in
1024000+0 records out
4194304000 bytes (4.2 GB) copied, 51.364 s, 81.7 MB/s

can anybody suggest me with any new way to read from the disk ?

Best Answer

skip (also known as iseek in some dd implementations) moves current pointer of the input stream while seek moves current pointer in the output stream.

Thus, by using skip you could ignore some data at the beginning of the input stream.

The seek is usually used (but not always) in conjunction with conv=notrunc to preserve some data existing at the beginning of the output stream.