Hi all<br><br>As some of you might know, last sunday (yesterday) there was a dipro fair in Hasselt.<br>Since both William (leader USB stick project) and Claudio (leader ISO project) where present, we talked about the new USB sticks and tried some things.<br>
<br>At the moment we're having sticks with 1 single ISO on it and some sticks with a multiboot of Ubuntu, Kubuntu, Xubuntu on them.<br>It striked us that we needed a simple way to copy files to the usb drives. (So we bought a hub at dipro to be able to write more USBcards at the same time)<br>
We used ddrescue to copy the image, but having to look for the right names of the devices and copying them 1 by 1, changing the drive letter was a bit cumbersome.<br><br>So this evening I set out to simplify that issue.<br>
<br><b>Ultimate goal -</b> masterstyle<br>I'm thinking about a small personal project that I've nicknamed "black box". The goal would be that you insert all drives, tell the program what the master is and it would duplicate that master to all the rest. Ideally, it would take the right image itself and copy to all drives without user input.<br>
<br>I was thinking about a single board computer with only 1 button and an LED. Pressing the button would make the script run, autoselecting the right image from the harddrive (sda) and copying it to all usb devices attached to it (sd*).<br>
<b><br>There I fixed it -</b> hackerstyle<br>So where are we at after 1 evening of coding?<br>I made a script called autoDD.sh (if you know a cooler name, please shoot!)<br>I'm not going to bother you all with the code right now, but this is how it works:<br>
<br>you launch the script by typing:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><i>sudo bash autoDD.sh /Master/Image/Or/Drive</i><br></blockquote>
<br>The script only works if you've got a computer with 1 harddrive (SDA) and if you've got a USB with the master file on it.<br>you insert that first, before the empty usb drives. you call the script with:<br><br>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><i>sudo bash autoDD.sh /dev/sdb</i><br></blockquote><br>Now the script always rejects /dev/sda because I've told it that that is the default harddrive, then it takes the drive you've provided (/dev/sdb) and then it copies that content to all other /dev/sd* devices.<br>
<br><b>Things to test<br></b>There are a couple things I need/want to test before releasing the code:<br><ul><li>having a master file in an ISO format.</li><ul><li>normally the script already works if you want this. You could in theory provide autoDD.sh with a /path/to/ISO instead of a /dev/sdb, but I haven't test it</li>
</ul><li>speed when writing to more than 1 or 2 USB devices at the same time</li><ul><li>Again, in theory all should be fine, but I didn't test it.</li></ul></ul><br>I'll test these things this week and I'll try to add a failsafe for people with more harddrives in their computer. (because this script will ruin your system if you have more than 1 hdd and/or if it isn't sda.<br>
<br>That being said, the script successfully copied the contents of 1 stick to 2 other sticks during my late night snack, so it does work.<br>If someone has a better idea to make it a real "blackbox" (with that I mean 1 button, 1 LED, tons of USB slots and no screen, mouse or keyboard), please give your views..<br>
<br>Grts<br><br><br>Wouter<br>