Erin.Gossamer has asked for the wisdom of the Perl Monks concerning the following question:
Hey everyone. First of all, I just want to say thanks for such a great and comprehensive perl community. As someone who is just starting in perl, perlmonks has proved to be an invaluable resource. Thanks to all who post questions and answers that keep me excited about moving forward with perl! (It's easy to want to call it quits when stuck in a jam)
Now to my question(s). I am writing a perl program that will image many cards at once. I am new to programming, but I am very experienced with linux. I used to image the cards using a bash script that would just dd the image to the sd card.
Ultimately, I want the script to allow the user to configure the card slots and an ID number for each card via a config file. I then want the program to read the config file, ask the user for confirmation, and then write to all the cards. I have the config file and many of my other little issues taken care of (thanks in large part to perl monks!). However, I have been unable to find an efficient way to issue many DD commands at once. For example, say that there are 5 card slots entered (/dev/sdb, /dev/sdc, etc (the partition number is not applicable as the dd image includes it's own partitions)). How would I enable my perl program to DD a file to all of those slots, ideally at the same time? The slots are $slot1, $slot2, $slot3, etc.
On my linux system, I generally pipe my DD commands through PV (pipe viewer) so that I may view the transfer rate, elapsed time, and other data that let's me know how it's going. I tried to do this with the system command from my perl script, but I wasn't given any progress, rather just the initial bar at 0. I understand why this is happening (essentially), and I was wondering if anyone would have a workaround on how I could get the output of PV in to my perl program so as to allow the user to view the status of the copies.
I am running these on a debian linux system. I'm sorry if my question is wordy, I appreciate the time and effort of everyone out there. I will be more than happy to clarify anything that may be unclear with my question. Thank you all very much.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pipe DD command?
by rovf (Priest) on Feb 09, 2012 at 15:49 UTC | |
|
Re: Pipe DD command?
by Riales (Hermit) on Feb 09, 2012 at 15:34 UTC | |
|
Re: Pipe DD command?
by Anonymous Monk on Feb 09, 2012 at 15:30 UTC |