Use a Raspberry Pi to wipe a USB thumbdrive
This is a quick hack to securely wipe a USB thumbdrive with a Raspberry Pi.
An LED attached to pins 11/12 will flash while the following is done:
- All of the data on the stick is shredded. 8GB takes 20-30 minutes
- New partition table loaded from the SD card, creates new 100MB partition at /dev/sda1
- Pin 11 held high if when complete
If any of the commands fail pin LED will remain off.
All commands, output and errors logged to /var/log/stick-destroyer.log
sudo apt-get install python-dev python-pip
sudo pip install rpi.gpio
/etc/udev/rules.d/99-stick-destroyer.rules
:
KERNEL=="sda", ACTION=="add", RUN+="/usr/local/bin/stick-destroyer.sh"
- Shell wrapper that's called by udev
/usr/local/bin/stick-destroyer.sh
:
#!/bin/bash
/usr/local/bin/stick-destroyer.py &
- Copy stick-destroyer.py to
/usr/local/bin
.