LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-26-2009, 10:13 PM   #1
adri_ht_
LQ Newbie
 
Registered: Feb 2009
Posts: 22

Rep: Reputation: 15
Data Dump Progress


Hey guys,

Lately I have been doing partition and disk cloning with dd, but I hate not to have a progress bar. I have googled a lot, but I can't find a straight answer to the matter. I know that by calling the pid or something I would get a dump of the progress.

Any hint will be greatly appreciated.

Thanks
 
Old 04-27-2009, 01:55 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
from "man dd"
Code:
       Sending a USR1 signal to a running `dd' process makes it print I/O sta-
       tistics to standard error and then resume copying.

              $ dd if=/dev/zero of=/dev/null& pid=$!
              $ kill -USR1 $pid; sleep 1; kill $pid
It's amazing how much information those manuals provide ...



Cheers,
Tink (your personal man page search engine)

Last edited by Tinkster; 04-27-2009 at 01:56 AM.
 
Old 04-27-2009, 10:36 AM   #3
adri_ht_
LQ Newbie
 
Registered: Feb 2009
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Tinkster View Post
from "man dd"
Code:
       Sending a USR1 signal to a running `dd' process makes it print I/O sta-
       tistics to standard error and then resume copying.

              $ dd if=/dev/zero of=/dev/null& pid=$!
              $ kill -USR1 $pid; sleep 1; kill $pid
Thanks for your prompt reply, and yes I always forget that man pages have most of the answers. Now, the above procedure is kind of confusing.

How would I apply that concept to this for example:

Code:
dd if=/dev/hda1 of=/dev/sda1 bs=4096
What is the meaning of the & and ! symbols. I know $ is used for variables.

On the net, I found similar way of doing it. A lot easier I think. Just by finding the pid of dd:

ps -A | grep dd

I can use the kill -USR1 to dump the progress:

kill -USR1 pid

Nevertheless, I would like to understand the way the man pages does it.
 
Old 04-27-2009, 03:20 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Well ... pid=$! stores the PID of the previous command (dd) in the
variable pid. It saves you having to try and find it using ps & grep
(two commands you needn't run using the method mentioned in the manual).

The ampersand put the dd into the background (so you can get the terminal
back and actually execute pid=$! [w/o having to do Ctrl-z and bg]).


man bash for details on $!, & and the likes ;}


Cheers,
Tink
 
Old 04-27-2009, 08:43 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Here's some good guides to Linux and bash:

http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How would I use the dd (dump data) command jacatone Linux - Newbie 1 05-26-2007 12:03 AM
dump is delete my data Linux For Ever Linux - General 1 09-21-2006 06:13 AM
data dump program help darkstate Linux - Newbie 1 07-06-2005 04:43 PM
Alternative for 'dump' to archive data ganninu Linux - General 0 02-16-2004 08:59 AM
Compressing data with DUMP chrisk5527 Linux - General 0 01-07-2004 06:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration