With little information on how to get this running on the GitHub page and not knowing a thing about Java, this took a little bit of playing around and also reaching out to the developer for help.
While this was a fun little project to complete, ultimately it doesn’t fulfill my use case. This program uses Rsync to copy files from one USB stick to another, which is great if it’s just random files but I want to be able to copy boot disks like Windows and recovery USB sticks for arcade games. This would require sector to sector copying like dd. I attempted to implement dd in replacement to the Rsync commands but with zero Java knowledge, I didn’t get far.
Regardless, if you are into the idea of a USB stick copier (for general files, not boot disks), this could be perfect for you.
Open the usb-copier project folder in Apache NetBeans and build the program. I saved the file called “usb-copier-0.0.2-jar-with-dependencies.jar” and copy it to /home/pi on the Raspberry Pi Zero via SSH.
Run sudo nano /boot/cmdline.txt and add iomem=relaxed
Enable I2C by running raspi-config and turn it on.
Set I2C data rate in config file. sudo nano /boot/config.txt & add ,i2c_arm_baudrate=1000000 after dtparam=i2c_arm=on
Extract libpi4j-pigpio.so to /home/pi: unzip -j usb-copier-0.0.2-jar-with-dependencies.jar lib/armhf/libpi4j-pigpio.so
Start at boot: sudo nano /etc/rc.local and add sudo bash -c 'nohup java -Dpi4j.library.path=/home/pi -jar /home/pi/usb-copier-0.0.2-jar-with-dependencies.jar &'
Sector to Sector copying with dd
I tried to modify the original script to utilise dd over rsync. With the help of the developer I managed to get the dd command to work but without a working progress bar (this is such a pain). I ended up starting to develop my own version of usb-copier by using something a little simpler like Python.
I’m a Python newbie, I’m still only at the GUI phase and it’s currently not working (no copy functionality yet).
If someone with more skills than me would like to take this challenge on, please reach out! Having a dedicated one-purpose stand-alone USB copier device that could be part of my daily tool-kit would be awesome.