I will be using a Raspberry Pi as an air-gapped computer to make secure encrypted transactions on the Ethereum BlockChain.
Once in awhile I will want to update the software I am using which will mean taking the SD card out of the Pi and inserting it into a laptop computer which is connected to the Internet. I would like to use some program or command line utility on the Pi to securely erase everything on the SD card before removing it as this will eliminate all possibility of sensitive information being read off the SD card by bad actors which may have compromised my laptop.
The following command typed in at the pi terminal conveys the idea of what I hope to accomplish:
shred --verbose *.*
Shred already supports passing multiple files, however you would be much safer shredding at the device level, since there is all sort of reallocation etc. happening within filesystems. I.E. something along the lines of:
SDCARD=/dev/sdb1
umount $SDCARD
shred --verbose $SDCARD
mkfs.ext4 $SDCARD
Note you can partition the SDCARD if there only a portion that you want to destructively recreate like this. – John Shearing Jun 19 '17 at 03:32
blkdiscard
. This may/should wipe sectors physically. – JimmyB Jun 19 '17 at 09:43