1834625 Members
3022 Online
110069 Solutions
New Discussion

Re: dd coomand

 
Sid Shapiro
Occasional Advisor

dd coomand

i have to use dd command to write onto to a rdisk .

what is wrong in this command

dd if=/dev/null of=/dev/vg123/rlovol1 bs=8 &


Iam doing some benchmarking stuff and want to generate lots of io's. Looking forward to your help.
Deepak Seth
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: dd coomand

Hi Tom,

When using /dev/null as input you always read 0 bytes though you can write an unlimited number of bytes to it.

You can use /dev/zero (if it exists otherwise you will need to create it) as input and it will supply endless ASCII NUL's.

If you need to create /dev/zero

mknod /dev/zero c 3 0x000004

Also, if you use /dev/zero you should probably supply a count=xxxxx value to stop it.

Regards, Clay
If it ain't broke, I can fix that.
Sid Shapiro
Occasional Advisor

Re: dd coomand

can i do like that

dd if=/dev/vgemc/rlvol22 of=/dev/vgnew1/rlvol1 bs=8

copy from one raw device to another ? Is the command ok.


Deepak Seth
A. Clay Stephenson
Acclaimed Contributor

Re: dd coomand

Hi again Tom,

Yes that is fine but bear in mind that you may be distorting your transfer rates. It's best to use the /dev/zero device for input and the /dev/null for output because then you are not confusing the transfer rates by introducing a second disk device. I notice that you are doing your i/o's in 8 byte chunks which is not the typical raw device io size.
Transfers of this size are normally buffered by the unix buffers or SGA.

Regards, Clay
If it ain't broke, I can fix that.
Sid Shapiro
Occasional Advisor

Re: dd coomand

do i need to careful with minor/major number while creating the /dev/zero file.
Deepak Seth
A. Clay Stephenson
Acclaimed Contributor

Re: dd coomand

Hi Tom:

Do an lsdev and look for character device 'mm'. It should be 3. Minor number is 0x04.

mknod /dev/zero c 3 0x04 should work just fine.
If it ain't broke, I can fix that.
Sid Shapiro
Occasional Advisor

Re: dd coomand

thanx clay . your suggestion just work great . i try to assign u points and was getting some error.
Deepak Seth
Bill Hassell
Honored Contributor

Re: dd coomand

Just as a note about benchmarking: Serial reads and writes are not typical, but can provide some useful data. However, the bs=8 is very disturbing. bs=8 is 8 bytes and is useless for benchmarking real applications. Perhaps you meant to say: bs=8k which will use 8192 byte transfers.


Bill Hassell, sysadmin