Operating System - HP-UX
1833381 Members
3674 Online
110052 Solutions
New Discussion

Re: A simple question on DD

 
TRAM
Occasional Advisor

A simple question on DD

How the dd command works ?
16 REPLIES 16
melvyn burnard
Honored Contributor

Re: A simple question on DD

man dd
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
James R. Ferguson
Acclaimed Contributor

Re: A simple question on DD

Hi:

The man pages for 'dd' contain quite a bit of information. Start there!

Regards!

...JRF...
TRAM
Occasional Advisor

Re: A simple question on DD

what kind of error messages can i have, if some blocks on the input disk are corrupted ?
Paul Sperry
Honored Contributor

Re: A simple question on DD

dd copies the specified input file to the specified output file with
possible conversions. The standard input and output are used by
default. Input and output block size can be specified to take
advantage of raw physical I/O. Upon completion, dd reports the number
of whole and partial input and output records.
TRAM
Occasional Advisor

Re: A simple question on DD

HI Manoj,

In this case :
"dd if=/dev/rdsk/c1t2d0 of=/dev/null count=10
This example reads the first 10 logical blocks from /dev/rdsk/c1t2d0 and write the output to /dev/null. In this case, the user is not interested in the data. Instead, the user is looking for error messages caused by the device i/o. "
what kind of error messages can i have?

Kelli Ward
Trusted Contributor

Re: A simple question on DD

Hi,

You could see IO errors or even no errors at all.

In my experience copying drives to each other; I played with a drive that had a fsck block read error, dd'd it for grins, the dd was "successfull" and the corrupted block was copied from one drive to the other, making them both obviously unusable.

What kind of problem are you having?

Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
Pete Randall
Outstanding Contributor

Re: A simple question on DD

DD is useful in testing for drive failures.

dd if=/dev/rdsk/c1t2d0 of=/dev/null bs=1024k

will attempt to read the entire disk and if it fails to do so will report an i/o error - a sure sign you need to replace the disk.

Pete

Pete
Kelli Ward
Trusted Contributor

Re: A simple question on DD

Oh I get you.
Off the top of my head, you might see an IO read error noting which block was being read at the time of failure.

I'm not sure I would trust dd as a reliable diagnostic tool.

You might want to consider Online Diags, if it's feasible for your situation.
HTH,
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
TRAM
Occasional Advisor

Re: A simple question on DD

A colleague have launched this command on two differents disks : dd if=/dev/rdsk/cXtYdT of=/dev/null bs=1024. He said me that the command return error messages but not what kind of errors. I can't acced to the srv now and my colleague is left.
Jose Mosquera
Honored Contributor

Re: A simple question on DD

Hi,

"dd if=/dev/rdsk/c1t2d0 of=/dev/null " is useful to identify by activity flashing a specific physicall disk location in an external box disk group.

Rgds.
Kelli Ward
Trusted Contributor

Re: A simple question on DD

Hi Pete -
Has dd been good for you?
Seems like it will only find the grossest of failures for me.
I don't really use it any more in favor of cstm, which seems to stress it more.
Or is it just me.
Curious,

Kel

N/A please
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
TRAM
Occasional Advisor

Re: A simple question on DD

Apparently the ioscan returns a state "claimed" for these two disks and the command diskinfo -v reports no errors.
Pete Randall
Outstanding Contributor

Re: A simple question on DD

Hi Kelli,

CSTM is probably a much more reliable indicator. DD is "old school", if you will.

I haven't had much occasion to search for failed disks lately. Nowadays the vast majority of my disk consists of RAID arrays and I get an e-mail that tells me one of the drives died - I walk over and pull the one out that has the error light on and pop in the spare that I keep on hand.

Pete

Pete
Kelli Ward
Trusted Contributor

Re: A simple question on DD

Hi Pete,
I hear you, I only use it when blasting the few older HP-UX 9x drives or as a teaching aid when people come to me wanting a "Disk to Disk" (I hate that!) to show is is actually a copy utility.

TRAM - If your friend is for example running a dd on a drive (fails), pulls it out, connects another in the same spot, (fails again), this could be indicative of a bad (slot, backplane, cable) depending on how it is connected. Might be a bad controller, but I would think you would be seeing big issues if that were the case. There is the remote possibility you have 2 defective drives, especially if your friend is using used drives for test.

I've seen it before.

HTH,
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
Kelli Ward
Trusted Contributor

Re: A simple question on DD

Hi again,
You could be seeing a CLAIMED ioscan output on a drive that just has minor issues with disks. The controller board may be fine. Have you tried to mediainit the drive?

Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
MANOJ SRIVASTAVA
Honored Contributor

Re: A simple question on DD

dd will jut report an I/O error it is kind of primitive tool to know any such issues . But still the dd coomand should report atleast an I/O error if there is one . You can also look for the help from system messaes or stm , xstm is a good online exerciser to check for errors.


Manoj Srivastava