LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Writing data to a raw disk using dd (https://www.linuxquestions.org/questions/linux-software-2/writing-data-to-a-raw-disk-using-dd-928423/)

barunparichha 02-09-2012 12:35 AM

Writing data to a raw disk using dd
 
Hi,
I have formatted my pen drive as a raw disk for testing purpose. How can I write data into that using dd ?


Regards,

fukawi1 02-09-2012 12:50 AM

Have you tried searching the forum?
Or google?
http://www.linuxquestions.org/linux/...ything_With_DD
http://www.linuxquestions.org/questions/tags/dd/

barunparichha 02-09-2012 04:15 AM

Actually, I was trying to send few bytes of data directly, but seems dd takes either from file or direct h/w interface.

dd if=/dev/sdc of=new bs=11 count=1

where
if=i/p interface, file to be read
of=o/p interface or file to be written
bs= block size in bytes
count = no of blocks

With Thanks,
Barun

rknichols 02-09-2012 02:26 PM

If you don't specify an input interface, dd reads from stdin. The data does, after all, have to come from someplace. If you just want to write zeros, or perhaps something random, specify "if=/dev/zero" or "if=/dev/urandom", respectively.


All times are GMT -5. The time now is 02:10 PM.