Operating System - HP-UX
1821413 Members
2603 Online
109633 Solutions
New Discussion юеВ

How long should the dd command take?

 
SOLVED
Go to solution
Adelaide Elmer
Occasional Advisor

How long should the dd command take?

I have been trying to clean vg00 using the dd command and it runs for hours and the system is still up. How long should it take? Is there a way to see if it is really working. I see it in the process list.
12 REPLIES 12
Luk Vandenbussche
Honored Contributor
Solution

Re: How long should the dd command take?

You are trying to clean up vg00 with dd,
are you using something like

dd if=/dev/null of=/dev/dsk/cxtydz bs= ..k?

Is cxtydz the primary disk of vg00?
In this case you erased also the command dd.

do you disk activity? Otherwise the system might hang.
spex
Honored Contributor

Re: How long should the dd command take?

Hello,

Depending on the exact command syntax, and especially if a small bs (blocksize) was specified, 'dd' may take a very long time to complete.

If you have 'tusc' installed, you can use 'tusc ' to display system calls. If you have Glance installed, you can bring up Process Resources and look for logical/physical reads/writes for the appropriate pid. You may also be able to use 'sar -d' or 'iostat' to look for activity on the associated physical devices, provided that you know what they are, and there isn't much other activity on vg00.

PCS
Adelaide Elmer
Occasional Advisor

Re: How long should the dd command take?

I used the following command and when I went to copy it I messed up and killed the process - it gave me the following - so I guess it looks like it was work??

# dd if=/dev/zero of=/dev/rdsk/c2t2d0 bs=1024

615525+0 records in
615524+0 records out


I started it again.
Adelaide Elmer
Occasional Advisor

Re: How long should the dd command take?

This is what I see with iostat

# iostat

device bps sps msps

c2t2d0 0 0.0 1.0

# ps -ef | grep dd
root 19018 29666 0 10:18:30 pts/ta 0:00 grep dd
root 18985 4305 0 10:13:03 pts/tc 0:01 dd if=/dev/zero of=/dev/rdsk/c2t2d0 bs=1024
# iostat

device bps sps msps

c2t2d0 0 0.0 1.0

#
A. Clay Stephenson
Acclaimed Contributor

Re: How long should the dd command take?

>> dd if=/dev/zero of=/dev/rdsk/c2t2d0 bs=1024

A blocksize of 1024 bytes is much too small and is hardly better than the default 512. You need to append a 'k' to your value so that, for example, bs=1024, specifies a 1MiB (1024KiB) blocksize. This will make you dd's go much faster. Anything above 1024KiB is pointless and indeed, you will only see very modest changes above 64KiB. With these larger blocksizes, your dd's should be finished in a few tens of minutes.
If it ain't broke, I can fix that.
Adelaide Elmer
Occasional Advisor

Re: How long should the dd command take?

Thanks! I am trying that now. I stopped the last process and restarted it - waiting to see it die :-)
Adelaide Elmer
Occasional Advisor

Re: How long should the dd command take?

iostat still looks the same -

# iostat

device bps sps msps

c2t2d0 0 0.0 1.0

# iostat

device bps sps msps

c2t2d0 0 0.0 1.0

# iostat

device bps sps msps

c2t2d0 0 0.0 1.0
spex
Honored Contributor

Re: How long should the dd command take?

Based on the output from 'dd', you zeroed out the first 630,296,576 bytes of /dev/rdsk/c2t2d0 (615524*1024). To verify:

# od -x /dev/rdsk/c2t2d0 |head -n 10

Now, you need to specify an interval (and optionally, a count) with 'iostat'. For example:

# iostat 5 12

instead of:

# iostat

PCS
A. Clay Stephenson
Acclaimed Contributor

Re: How long should the dd command take?

Ooops, makes sure that you say "bs=1024k". After telling you that you needed a "k", I left it off in my example. That was state-of-the-art stupid.
If it ain't broke, I can fix that.
Adelaide Elmer
Occasional Advisor

Re: How long should the dd command take?

So does this look correct?

# ps -ef | grep dd
root 19088 19058 0 10:48:38 pts/ta 0:00 grep dd
root 19033 29666 227 10:23:34 pts/ta 0:09 dd if=/dev/zero of=/dev/rdsk/c2t2d0 bs=1024k

Might have some action. I can not execute some scripts anymore in my home directory. I guess I have to be patient. Thanks for all of the help!
A. Clay Stephenson
Acclaimed Contributor

Re: How long should the dd command take?

Yes, that will do the trick.
If it ain't broke, I can fix that.
Adelaide Elmer
Occasional Advisor

Re: How long should the dd command take?

It worked.