Ever wanted to recklessly format any USB drive plugged into your Raspberry Pi into exFAT?
Now you can!
Reckless exFAT Formatter is a Bash script that attempts to quickly format any plugged in USB drive into exFAT. It also will write a customizable info.txt
to the USB drive once finished.
Don't like exFAT? Reckless exFAT Formatter is easy to customize to your needs. It's literally just Bash commands. Open it up and edit the _formatDrive()
function with the command of your choice.
exfat-fuse
exfat-utils
Install with:
sudo apt-get install exfat-fuse
sudo apt-get install exfat-utils
This script is triggered by Udev. So lets create a Udev rule to detect when a USB drive is plugged in.
- Create and open the
.rules
file.
sudo nano /etc/udev/rules.d/99-reckless-formatter.rules
- Add this rule to the file. (It will be the only one there)
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", RUN+="/usr/local/bin/reckless-formatter.sh"
- Save and exit Nano.
Press ctrl + x
to save.
Press y
to confirm
Press Enter
to exit.
Download reckless-formatter.sh
and place it in /usr/local/bin/
For example
sudo mv ~/Downloads/reckless-formatter.sh /usr/local/bin/reckless-formatter.sh
You can now customize the name and info of formatted USB sticks by editing the _formatDrive()
and _writeInfo()
functions.
sudo nano /usr/local/bin/reckless-formatter.sh
Once you're happy with your customizations you can give the script executable permissions.
sudo chmod +x /usr/local/bin/reckless-formatter.sh
You are now ready to recklessly format drives!
- Plug in USB drive.
- Wait between 10 and 60 seconds.
- Unplug the drive.
Running this script is a bad idea for most people. Unless you know that you need something specifically like this, I recommend you either create your own or use something else.
Currently there is a 5 second window of time for you to remove the drive before it is formatted.
This is NOT a security tool! Your data is not securely removed when using this script.