Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

dd progress info for long operations

 
   Soft32 Home -> Linux -> Slackware RSS
Next:  masquerade as?  
Author Message
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 1) Posted: Tue Sep 29, 2009 7:20 pm
Post subject: dd progress info for long operations
Archived from groups: alt>os>linux>slackware (more info?)

Hi there,

Preparing an old hdd for reuse, first I want to wipe it to zeroes
with dd. I'm curious about progress too, so here's how to see the
dd status each ten seconds.

clear hdd:
~# dd if=/dev/zero bs=4k of=/dev/hdc

discover pid:
~$ ps aux|grep dd\ |grep -v grep
root 1685 30.7 0.2 1892 708 pts/3 R+ 09:06 5:48 dd if /dev/zero bs 4k of /dev/hdc
^^^^

In another root terminal, drive the dd status request signal:
~# while :; do kill -usr1 1685; sleep 10; done

Each dd progress report looks like:
8721060+0 records in
8721060+0 records out
35721461760 bytes (36 GB) copied, 1366.35 seconds, 26.1 MB/s

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
Simon Sibbez

External


Since: Nov 01, 2008
Posts: 9



(Msg. 2) Posted: Tue Sep 29, 2009 9:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Grant wrote:

> Preparing an old hdd for reuse, first I want to wipe it to zeroes
> with dd. I'm curious about progress too, so here's how to see the
> dd status each ten seconds.

Don't do that in a busybox environment. The dd implementation just
quits when it receives the signal.

/S.
Back to top
Login to vote
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 3) Posted: Tue Sep 29, 2009 9:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 30 Sep 2009 02:21:21 +0200, Simon Sibbez <simon.sibbez.TakeThisOut@buerotiger.de> wrote:

>Grant wrote:
>
>> Preparing an old hdd for reuse, first I want to wipe it to zeroes
>> with dd. I'm curious about progress too, so here's how to see the
>> dd status each ten seconds.
>
>Don't do that in a busybox environment. The dd implementation just
>quits when it receives the signal.

Learn something every day Smile

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
Jim Diamond

External


Since: Sep 04, 2007
Posts: 15



(Msg. 4) Posted: Tue Sep 29, 2009 9:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2009-09-29 at 20:30 ADT, Grant <g_r_a_n_t_ RemoveThis @bugsplatter.id.au> wrote:
> Hi there,
>
> Preparing an old hdd for reuse, first I want to wipe it to zeroes
> with dd. I'm curious about progress too, so here's how to see the
> dd status each ten seconds.
>
> clear hdd:
> ~# dd if=/dev/zero bs=4k of=/dev/hdc
>
> discover pid:
> ~$ ps aux|grep dd\ |grep -v grep
> root 1685 30.7 0.2 1892 708 pts/3 R+ 09:06 5:48 dd if /dev/zero bs 4k of /dev/hdc
> ^^^^
>
> In another root terminal, drive the dd status request signal:
> ~# while :; do kill -usr1 1685; sleep 10; done

killall is your friend...

$ killall -usr1 dd

(assuming you only have the one dd running, of course)


Jim
Back to top
Login to vote
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 5) Posted: Tue Sep 29, 2009 11:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 29 Sep 2009 23:06:34 -0300, Jim Diamond <Jim.Diamond DeleteThis @nospam.AcadiaU.ca> wrote:

>On 2009-09-29 at 20:30 ADT, Grant <g_r_a_n_t_ DeleteThis @bugsplatter.id.au> wrote:
>> Hi there,
>>
>> Preparing an old hdd for reuse, first I want to wipe it to zeroes
>> with dd. I'm curious about progress too, so here's how to see the
>> dd status each ten seconds.
>>
>> clear hdd:
>> ~# dd if=/dev/zero bs=4k of=/dev/hdc
>>
>> discover pid:
>> ~$ ps aux|grep dd\ |grep -v grep
>> root 1685 30.7 0.2 1892 708 pts/3 R+ 09:06 5:48 dd if /dev/zero bs 4k of /dev/hdc
>> ^^^^
>>
>> In another root terminal, drive the dd status request signal:
>> ~# while :; do kill -usr1 1685; sleep 10; done
>
>killall is your friend...
>
>$ killall -usr1 dd
>
>(assuming you only have the one dd running, of course)

Well, if you had several running, each in its own terminal?

Hmm, almost worked...

root@deltree:~# while :; do killall -usr1 dd; sleep 10; done
Cannot find user sr1
^C
root@deltree:~# while :; do killall -USR1 dd; sleep 10; done

And yes, two running instances of dd updated together Smile

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
Harold

External


Since: Sep 30, 2009
Posts: 1



(Msg. 6) Posted: Wed Sep 30, 2009 9:19 am
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Grant wrote:
> Hi there,
>
> Preparing an old hdd for reuse, first I want to wipe it to zeroes
> with dd. I'm curious about progress too, so here's how to see the
> dd status each ten seconds.
>
> clear hdd:
> ~# dd if=/dev/zero bs=4k of=/dev/hdc
>
> discover pid:
> ~$ ps aux|grep dd\ |grep -v grep
> root 1685 30.7 0.2 1892 708 pts/3 R+ 09:06 5:48 dd if /dev/zero bs 4k of /dev/hdc
> ^^^^
>
> In another root terminal, drive the dd status request signal:
> ~# while :; do kill -usr1 1685; sleep 10; done
>
> Each dd progress report looks like:
> 8721060+0 records in
> 8721060+0 records out
> 35721461760 bytes (36 GB) copied, 1366.35 seconds, 26.1 MB/s
>
> Grant.

Another method is to use the ddrescue command like the following.


ddrescue -v -b4k /dev/zero /dev/hdc


Harold
Back to top
Login to vote
Jim Diamond

External


Since: Sep 04, 2007
Posts: 15



(Msg. 7) Posted: Wed Sep 30, 2009 9:20 am
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2009-09-29 at 23:23 ADT, Grant <g_r_a_n_t_.DeleteThis@bugsplatter.id.au> wrote:
> On Tue, 29 Sep 2009 23:06:34 -0300, Jim Diamond <Jim.Diamond.DeleteThis@nospam.AcadiaU.ca> wrote:
>
>>On 2009-09-29 at 20:30 ADT, Grant <g_r_a_n_t_.DeleteThis@bugsplatter.id.au> wrote:
>>> Hi there,
>>>
>>> Preparing an old hdd for reuse, first I want to wipe it to zeroes
>>> with dd. I'm curious about progress too, so here's how to see the
>>> dd status each ten seconds.
>>>
>>> clear hdd:
>>> ~# dd if=/dev/zero bs=4k of=/dev/hdc
>>>
>>> discover pid:
>>> ~$ ps aux|grep dd\ |grep -v grep
>>> root 1685 30.7 0.2 1892 708 pts/3 R+ 09:06 5:48 dd if /dev/zero bs 4k of /dev/hdc
>>> ^^^^
>>>
>>> In another root terminal, drive the dd status request signal:
>>> ~# while :; do kill -usr1 1685; sleep 10; done
>>
>>killall is your friend...
>>
>>$ killall -usr1 dd
>>
>>(assuming you only have the one dd running, of course)
>
> Well, if you had several running, each in its own terminal?
>
> Hmm, almost worked...
>
> root@deltree:~# while :; do killall -usr1 dd; sleep 10; done
> Cannot find user sr1
> ^C
> root@deltree:~# while :; do killall -USR1 dd; sleep 10; done
mea culpa!

> And yes, two running instances of dd updated together Smile
What the heck, why not go for 3 or 4 ? Smile

I'm sort of curious about the filling it with zeroes... was there top
secret stuff on it?

Jim
Back to top
Login to vote
Henrik Carlqvist

External


Since: Sep 09, 2005
Posts: 92



(Msg. 8) Posted: Wed Sep 30, 2009 1:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Harold <harold.RemoveThis@everywhere.com> wrote:
> Another method is to use the ddrescue command like the following.
> ddrescue -v -b4k /dev/zero /dev/hdc

Yet another method is to use some buffer program which displays progress
to stderr. There are different programs to choose from, one of my
favorites is bfr, http://www.glines.org/software/bfr

dd if=/dev/zero | bfr -p | dd of=/dev/hdc

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost
Back to top
Login to vote
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 9) Posted: Wed Sep 30, 2009 3:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 30 Sep 2009 10:04:09 -0300, Jim Diamond <Jim.Diamond DeleteThis @nospam.AcadiaU.ca> wrote:

>On 2009-09-29 at 23:23 ADT, Grant <g_r_a_n_t_ DeleteThis @bugsplatter.id.au> wrote:
>> On Tue, 29 Sep 2009 23:06:34 -0300, Jim Diamond <Jim.Diamond DeleteThis @nospam.AcadiaU.ca> wrote:
>>
>>>On 2009-09-29 at 20:30 ADT, Grant <g_r_a_n_t_ DeleteThis @bugsplatter.id.au> wrote:
>>>> Hi there,
>>>>
>>>> Preparing an old hdd for reuse, first I want to wipe it to zeroes
>>>> with dd. I'm curious about progress too, so here's how to see the
>>>> dd status each ten seconds.
>>>>
>>>> clear hdd:
>>>> ~# dd if=/dev/zero bs=4k of=/dev/hdc
>>>>
>>>> discover pid:
>>>> ~$ ps aux|grep dd\ |grep -v grep
>>>> root 1685 30.7 0.2 1892 708 pts/3 R+ 09:06 5:48 dd if /dev/zero bs 4k of /dev/hdc
>>>> ^^^^
>>>>
>>>> In another root terminal, drive the dd status request signal:
>>>> ~# while :; do kill -usr1 1685; sleep 10; done
>>>
>>>killall is your friend...
>>>
>>>$ killall -usr1 dd
>>>
>>>(assuming you only have the one dd running, of course)
>>
>> Well, if you had several running, each in its own terminal?
>>
>> Hmm, almost worked...
>>
>> root@deltree:~# while :; do killall -usr1 dd; sleep 10; done
>> Cannot find user sr1
>> ^C
>> root@deltree:~# while :; do killall -USR1 dd; sleep 10; done
>mea culpa!
>
>> And yes, two running instances of dd updated together Smile
>What the heck, why not go for 3 or 4 ? Smile

Because it's a single drive and all one does is lose time in head
seeking, so writing two adjacent partitions ran at about half speed.

But if I was lucky enough to be wiping 5 drives in parallel? It'd
be fun. But I haven't had that many drives in one spot since once
I bought 5 x 270MB SCSI drives to play with RAID about a decade ago,
discovering RAID on narrow scsi was a silly idea Sad
>
>I'm sort of curious about the filling it with zeroes... was there top
>secret stuff on it?

No. Filling a drive with zeroes gives the hdd controller a chance to
remap any iffy sectors. Modern hdd lie to OS about sector size, so
an iffy sector can only be replaced when OS asks for entire 'real'
(much larger) sector is written. Thus writing all zeroes to a drive
is somewhat like the old 'low level format'.

In fact this is all that the Seagate disk recovery software (for
warranty testing) does, write zeroes to entire drive then test it.

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 10) Posted: Wed Sep 30, 2009 3:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 30 Sep 2009 09:19:14 -0400, Harold <harold.TakeThisOut@everywhere.com> wrote:

....
>Another method is to use the ddrescue command like the following.
>
>
>ddrescue -v -b4k /dev/zero /dev/hdc

~# ddrescue --version
-bash: ddrescue: command not found

Not in slack-11 Sad

Didn't ddrescue features get folded into dd? Or was that a special
dd I saw somewhen?

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
Helmut Hullen

External


Since: Nov 02, 2008
Posts: 27



(Msg. 11) Posted: Wed Sep 30, 2009 3:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hallo, Grant,

Du meintest am 01.10.09:

>> Another method is to use the ddrescue command like the following.
>>
>>
>> ddrescue -v -b4k /dev/zero /dev/hdc

> ~# ddrescue --version
> -bash: ddrescue: command not found

> Not in slack-11 Sad

Try "linuxpackages.net", search for "any" version. You'll find
"ddrescue-1.10-i486-1McD.tgz".

> Didn't ddrescue features get folded into dd?

No - sorry.

Viele Gruesse
Helmut

"Ubuntu" - an African word, meaning "Slackware is too hard for me".
Back to top
Login to vote
Sylvain Robitaille

External


Since: Dec 06, 2004
Posts: 75



(Msg. 12) Posted: Wed Sep 30, 2009 5:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Grant wrote:

>>killall is your friend...
>>$ killall -usr1 dd

> root@deltree:~# while :; do killall -USR1 dd; sleep 10; done
>
> And yes, two running instances of dd updated together Smile

Even more elegant?

watch -n 10 killall -USR1 dd

--
----------------------------------------------------------------------
Sylvain Robitaille syl.TakeThisOut@encs.concordia.ca

Systems analyst / AITS Concordia University
Faculty of Engineering and Computer Science Montreal, Quebec, Canada
----------------------------------------------------------------------
Back to top
Login to vote
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 13) Posted: Wed Sep 30, 2009 9:20 pm
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 30 Sep 2009 21:23:26 +0000 (UTC), Sylvain Robitaille <syl.TakeThisOut@alcor.concordia.ca> wrote:

>Grant wrote:
>
>>>killall is your friend...
>>>$ killall -usr1 dd
>
>> root@deltree:~# while :; do killall -USR1 dd; sleep 10; done
>>
>> And yes, two running instances of dd updated together Smile
>
>Even more elegant?
>
> watch -n 10 killall -USR1 dd

I never used watch -- it's hidden under a few high use-polished tools
over in the far corner Smile

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
Grant

External


Since: Nov 02, 2008
Posts: 81



(Msg. 14) Posted: Sat Oct 03, 2009 3:20 am
Post subject: Re: dd progress info for long operations [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 30 Sep 2009 02:21:21 +0200, Simon Sibbez <simon.sibbez.DeleteThis@buerotiger.de> wrote:

>Grant wrote:
>
>> Preparing an old hdd for reuse, first I want to wipe it to zeroes
>> with dd. I'm curious about progress too, so here's how to see the
>> dd status each ten seconds.
>
>Don't do that in a busybox environment. The dd implementation just
>quits when it receives the signal.

Slack-13 (32bit) installer's dd works fine handling this signal today.

Busybox dd didn't show bytes transferred, so I used 'bs=1M' Smile

Grant.
--
http://bugsplatter.id.au
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Assigning two NICs - I have a Slackware box with two NICs. With Slackware 10.2, device eth0 gets assigned to NIC #1 (a VIA Rhine built-in..

best way to setup bridge for qemu - I'd like to setup a bridge using the tun/tap driver on my slackware 12 system but still be able to use the..

Slackware 12.0: cannot view or print postscript files - Hi I just upgraded from Slack 11.0 to 12.0 following instructions from..

[PATCH] ax88796 (address space): cast to unsigned long, no.. - Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> --- drivers/net/ax88796.c | 2 +- 1 files changed, 1 inserti...

How to printk unsigned long long variable? - For example, typedef unsigned long long u64; u64 *dma_mask; Then how to use printk() to print out a dma_mask variable...

Debian armel on NSLU2 a bit more progress... - After several people pointed out that I needed to copy over firmware for the NPE network driver (DOH!), I have done so...
       Soft32 Home -> Linux -> Slackware All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]