I'm designing a kiosk device with a Raspberry Pi.
The device is powered down by removing power without warning (not by graceful shut-down).
If a USB drive is mounted at the time (say "SanDisk"), at the next power-up, the "SanDisk" folder is still present in /media/pi/ (though inaccessible), and a new folder, "SanDisk1", appears.
After 100 times, there are 100 folders in /media/pi/, from "SanDisk1" to "SanDisk99".
What's the best way to clear the ghost USB folders from /media/pi/?
I can use a Python script.
add a button to turn this off gracefully. -- That "ain't gonna happen": a kiosk that any Tom, Dick and Harry uses, and you expect them to be knowledgeable enough and kind enough to find the "shut down" button before yanking out the power cord? Huh, huh; not happening.
– Davide Andrea Oct 02 '17 at 14:55