- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- DD Command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2010 09:38 PM
тАО10-25-2010 09:38 PM
DD Command
# dd if=/dev/rdsk/c0t1d0 of=/dev/null bs=1024k count=64 &
What is happening behind the above command?
Output1:
64+0 records in
64+0 records out
What info the above/below output give?
Output2:
dd read error: I/O error
0+0 records in 0+0 records out
Thanks in advance...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2010 09:42 PM
тАО10-25-2010 09:42 PM
Re: DD Command
Some Useful Examples ;
dd read test :
dd if=/dev/dsk/cxtydz of=/dev/null bs=256k
convert a text file to UPPERCASE:
# dd if=/aydin/jokes.txt of=x conv=ucase
0+1 records in
0+1 records out
Divide a file to reduce size to edit by copying 10 blocks only:
# dd if=input_file of=/tmp/output_file.1 count=10
Divide a file to reduce size to edit by skipping first 10 block and copying 10 blocks only:
# dd if=input_file of=/tmp/output_file.1 iseek=10 count=10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2010 09:55 PM
тАО10-25-2010 09:55 PM
Re: DD Command
Output1:
64+0 records in
64+0 records out
==> This says, at the end of the command, this was the result ( even if you interrupt , it gives) this many records were read from the input file to output file.
What info the above/below output give?
Output2:
dd read error: I/O error
0+0 records in
0+0 records out
There was an I/O error and it could int read from the source. If your input file was a disk , the error may come because of disk read error.
We use this command to check the integrity of disk. Remember this command may hang if there is serious problems with the disk.
Regards,
Sooraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2010 10:02 PM
тАО10-25-2010 10:02 PM
Re: DD Command
What could be output of above command.
Will this command check the I/O func of /dev/rdsk/c0t1d0 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2010 10:10 PM
тАО10-25-2010 10:10 PM
Re: DD Command
Output1:
64+0 records in
64+0 records out
64 records are successfully read and written;
Output2:
dd read error: I/O error
0+0 records in 0+0 records out
there was an I/O error when reading the disk.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2010 05:22 AM
тАО10-26-2010 05:22 AM
Re: DD Command
> What could be output of above command.
The main output is discarded, send to the big bit bucket in the sky (null device)
A detailed success or error message will go to stderr, as you have shown
>> Will this command check the I/O func of /dev/rdsk/c0t1d0 ?
Yes, partially.
It will test that the first 64 MB of the selected raw device can be read.
That tests 99% of the circuitry ( driver, hba, controller, cabling, drive electronics.)
It tests wll less than 1% of the total data and only tests reads, no writes.
cheers,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2010 05:36 AM
тАО10-26-2010 05:36 AM
Re: DD Command
>>What could be output of above command.
>>>The main output is discarded, send to the big bit bucket in the sky (null device)
Look at his command closer! He is taking /dev/null as the INPUT as using /dev/rdsk/c0t1d0 as the OUTPUT device.
What this will do is OVERWRITE the first 64 MB (1024k x 64 times) of the disk with NULLs. If this disk is not in use, then maybe this is OK. If this disk is in use, you just killed it as you overwrote all of the VG configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2010 05:48 AM
тАО10-26-2010 05:48 AM
Re: DD Command
In the first post it is
# dd if=/dev/rdsk/c0t1d0 of=/dev/null bs=1024k count=64 &
but in the second
# dd if=/dev/null of=/dev/rdsk/c0t1d0 bs=1024k count=64 &
(this will write to the disk and destroy data!)
This could be related to this thread
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1453526
;-)
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2010 08:23 AM
тАО10-26-2010 08:23 AM
Re: DD Command
Our anonyous friend change the rule on me!
Now I understand the question better... I thought it was a repeat/rephrase.
But apparently he/she moved to the next questions in the homework assignment.
But while were are correcting....
Patrick>># dd if=/dev/null of=/dev/rdsk/c0t1d0 bs=1024k count=64 &
Patrick>> What this will do is OVERWRITE the first 64 MB (1024k x 64 times) of the disk with NULLs.
I beg to differ with the follow up comments.
The command will read EOF right away and copy 0 records.
The next question is likely about "if=/dev/zero". That woes provide an infinite suppy of zeroes as you refer to, but "null" does not.
So I think nothing will happen to the output, as the input fails, but I am in no rush to try verify this on anything but a play system :-)
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2010 08:31 AM
тАО10-26-2010 08:31 AM
Re: DD Command
I believe you may be correct. I just did the following:
$ dd if=/dev/null of=test bs=1024k count=64
0+0 records in
0+0 records out
So, yes when 'dd' receives the first 'null' it exits, though it did create the 'test' output file with a size of 0.
How would this affect an actual disk device though.... Good question. It very well may not do anything to harm the disk. But like you I do not want to try it.
If the command were to use /dev/random or /dev/zero, then you would overwrite data on the disk.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2010 09:28 AM
тАО10-26-2010 09:28 AM
Re: DD Command
http://www.brandonhutchinson.com/Mirroring_disks_with_DiskSuite.html