clone an USB stick using dd + see its process

dd if=/dev/sdc of=/dev/sdd conv=notrunc & while killall -USR1 dd; do sleep 5; done
The following command will clone usb stick inside /dev/sdc to /dev/sdd Double check you got the correct usb sticks (origional-clone)with fdisk -l.

3
By: bw
2010-01-12 14:09:40

6 Alternatives + Submit Alt

What Others Think

I think you meant to use just one & in the above command. Otherwise it won't run the while killall until the dd is done. The problem with doing this is that if you do this as root or something on a multiuser system, you are going to end up sending the USR1 signal to any dd that is running. So you can imagine if another user was running dd and suddenly they say the status output from it, they might wonder what the hell is going on. You could use $! to get the PID of the last process you ran. However, in the interest of improving upon your idea, I found out something interesting about the dd command. Apparently, if you pass the USR1 signal to it too quickly, it just dies. If you just do something like this: dd if=/dev/sdc of=/dev/sdd conv=notrunc & while kill -USR1 $! ; do sleep 5 ; done At least on my system, the dd dies immediately, I guess because it received the USR1 signal before it could set it self up to trap it. So you have to do this in order to delay it enough so that you don't kill the dd: dd if=/dev/sdc of=/dev/sdd conv=notrunc & DDPID=$! ; sleep 1 ; while kill -USR1 $DDPID ; do sleep 5 ; done The DDPID=$! is needed otherwise you'd get he PID of the sleep 1 process.
deltaray · 681 weeks and 1 day ago
You are right, thx for the correction I noticed your observation too btw! About the dd dying.
bw · 681 weeks and 1 day ago
On OSX (Mountain Lion) dd wants `-SIGINFO`, not `-USR1` and also for some reason DDPID was being assigned the process *before* the current one so I had to run the signal loop in a separate terminal window after `ps aux | grep dd`-ing to get the process number. Thx though. I've learned a lot just now!
harikaram · 502 weeks and 4 days ago
You can learn so many such commands through this website and this one is the best learning platform for flutter training kochi people. So glad to see the commands for cloning a USB stick using dd + see its process. You can see its alternatives here and I am looking here for more updates on that.
Alyssalauren · 32 weeks and 5 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale pug puppies indiana Amazing! This blog looks just like my old one! It's on a completely different subject but it has pretty much the same layout and design. Wonderful choice of colors!
rahimhh21 · 21 weeks and 6 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies baby pug puppies for sale pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
Perfecthomepugs · 13 weeks and 2 days ago
Keep up the good work , I read few posts on this web site and I conceive that your blog is very interesting and has sets of fantastic information. Zwembad aanleggen
DigitalZone · 5 days ago
Thank you for some other informative website. The place else may just I get that kind of information written in such a perfect method? I have a venture that I am simply now running on, and I’ve been at the glance out for such info. Zonnepanelen Sint-Genesius-Rode
DigitalZone · 5 days ago
Efficiently written information. It will be profitable to anybody who utilizes it, counting me. Keep up the good work. For certain I will review out more posts day in and day out. Polyester zwembad
DigitalZone · 5 days ago
Wow, cool post. I’d like to write like this too – taking time and real hard work to make a great article… but I put things off too much and never seem to get started. Thanks though. Zonnepanelen Sint-Pieters-Leeuw
DigitalZone · 5 days ago
I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. Inox zwembad
DigitalZone · 5 days ago
A great content material as well as great layout. Your website deserves all of the positive feedback it’s been getting. I will be back soon for further quality contents. Zonnepanelen Steenokkerzeel
DigitalZone · 5 days ago
Only strive to mention one's content can be as incredible. This clarity with your post is superb! Thanks a lot, hundreds of along with you should go on the pleasurable get the job done. Monoblok zwembad
DigitalZone · 5 days ago
I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing. Zonnepanelen Ternat
DigitalZone · 5 days ago
This is very interesting content! I have thoroughly enjoyed reading your points and have come to the conclusion that you are right about many of them. You are great. Keramische zwembaden
DigitalZone · 5 days ago
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! Zonnepanelen Tervuren
DigitalZone · 5 days ago
Interesting and amazing how your post is! It Is Useful and helpful for me That I like it very much, and I am looking forward to Hearing from your next.. Vinylester zwembad
DigitalZone · 5 days ago
Succeed! It could be one of the most useful blogs we have ever come across on the subject. Excellent info! I’m also an expert in this topic so I can understand your effort very well. Thanks for the huge help. Zonnepanelen Tielt-Winge
DigitalZone · 5 days ago
I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing. Aanleg zwembad
DigitalZone · 5 days ago
Nice to be visiting your blog once more, it has been months for me. Well this article that ive been waited for therefore long. i want this article to finish my assignment within the faculty, and it has same topic together with your article. Thanks, nice share. Zonnepanelen Tienen
DigitalZone · 5 days ago
it was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity.. LPW zwembad
DigitalZone · 5 days ago
I am unable to read articles online very often, but I’m glad I did today. This is very well written and your points are well-expressed. Please, don’t ever stop writing. Zonnepanelen Vilvoorde
DigitalZone · 5 days ago
Believe it or not, it is the type of information I’ve long been trying to find. It matches to my requirements a lot. Thank you for writing this information. Monoblock zwembaden
DigitalZone · 5 days ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Zonnepanelen Wemmel
DigitalZone · 5 days ago
You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. Zwembad plaatsen
DigitalZone · 5 days ago
Only strive to mention one's content can be as incredible. This clarity with your post is superb! Thanks a lot, hundreds of along with you should go on the pleasurable get the job done. Zonnepanelen Tremelo
DigitalZone · 5 days ago
We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. Zwembad tuin
DigitalZone · 5 days ago
Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. Zonnepanelen Wezembeek-Oppem
DigitalZone · 5 days ago
I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. Zwembad laten plaatsen
DigitalZone · 5 days ago
Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! Zonnepanelen Zaventem
DigitalZone · 5 days ago
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Zwembad bouwen
DigitalZone · 5 days ago
I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. Zonnepanelen Zemst
DigitalZone · 5 days ago
This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work Laserontharing
DigitalZone · 5 days ago
Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene. Zonnepanelen Zoutleeuw
DigitalZone · 5 days ago
Great job here on _______ I read a lot of blog posts, but I never heard a topic like this. I Love this topic you made about the blogger's bucket list. Very resourceful. Permanente ontharing
DigitalZone · 5 days ago
Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks. Zonnepanelen
DigitalZone · 2 days ago
An interesting dialogue is price comment. I feel that it is best to write more on this matter, it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next. Cheers. Zonnepanelen Antwerpen
DigitalZone · 2 days ago
Hey, this day is too much good for me, since this time I am reading this enormous informative article here at my home. Thanks a lot for massive hard work. Zonnepanelen
DigitalZone · 2 days ago
Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! Zonnepanelen
DigitalZone · 2 days ago
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! Thuisbatterij
DigitalZone · 2 days ago
The writer has outdone himself this time. It is not at all enough; the website is also utmost perfect. I will never forget to visit your site again and again. Airco
DigitalZone · 2 days ago
Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. Zonnepanelen kopen
DigitalZone · 2 days ago
It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait reading. I am impressed with your work and skill. Thanks. Zonnepanelen kopen
DigitalZone · 2 days ago
I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts. REC zonnepanelen
DigitalZone · 2 days ago
This is highly informatics, crisp and clear. I think that everything has been described in systematic manner so that reader could get maximum information and learn many things. Zonnepanelen installateur
DigitalZone · 2 days ago
I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing. Zonnepanelen Hasselt
DigitalZone · 2 days ago
I am continually amazed by the amount of information available on this subject. What you presented was well researched and well worded in order to get your stand on this across to all your readers. Airconditioning
DigitalZone · 2 days ago
This article is an appealing wealth of informative data that is interesting and well-written. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention. Thuisbatterij kopen
DigitalZone · 2 days ago
I am jovial you take pride in what you write. It makes you stand way out from many other writers that can not push high-quality content like you. Airco installatie
DigitalZone · 2 days ago
This article was written by a real thinking writer without a doubt. I agree many of the with the solid points made by the writer. I’ll be back day in and day for further new updates. Zonnepanelen installateur Hasselt
DigitalZone · 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: