dd command

danielemazza

New Member
Joined
Jan 30, 2020
Messages
2
Reaction score
1
Credits
0
Hi
Could someone explain better the option seek and bs in this command?
dd if=test_file.bin of=/dev/sdb1 bs=1024 seek=8
Why "test_file.bin" has been correctly copied on /dev/sdb1(/dev/sdb1/ is extern sd device ex3 normaly mounted with the "mount command") but with "ls" command i am not able to see that file on the device?

Thanks in advance
Best
 


bs is the chunks( in bytes) it writes at a time and if you also put in (seek at 8) then it means it will leave this space 1024x8 (for your settings) on the destination (of=) before it starts writing to that the destination. in other words, there will be a gap on the destination of 1042x 8 bytes before data is written i've used dd before say for doing a fedora iso to a stick using bs=8M setting that would be 819200 bytes but using 4M is not uncommon .if you don't use the bs option i think the default is 512 bytes at a time . I have no idea how long that would take if your doing a dd of say 3.5 gig to a stick , although i'm sure someone will tell you. Also there is no output from dd command until finished so you might be sitting there wondering is it working. i've read you can do this
Code:
dd if=/dev/sdaxx  |pv| of=/dev/sdbxx

but i myself have not tried that
 
Last edited:
Good question! It inspired me to look up information and learn something today :)

From the dd manpage:
seek=N skip N obs-sized blocks at start of output

From the www3.nd.edu site: https://www3.nd.edu/~pbui/teaching/cse.20189.sp16/homework07.html
seek: This specifies how many blocks (if any) we should skip in the output file.

From a stackexchange question: https://unix.stackexchange.com/questions/108858/seek-argument-in-command-dd
obs=expr
Specify the output block size, in bytes, by expr (default is 512).

obs = output block size
 
Maybe i do not explain in right way...Any kind of copy of that file with the dd command i am not able to see it in the destination folder(sd usb or whatever).
What i am wronging?
 

Members online


Top