Allow to unmount USB/SD storage before power off

Posted by rasos 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Allow to unmount USB/SD storage before power off
April 17, 2016 11:47AM
I have frequent issues with the USB sticks on several TP3020/3040 based pirateboxes.
I assume this is related to powering off without halting the system and unmounting all external storage devices. Typical symptoms are that the Piratebox is showing its WIFi network, but is not offering DHCP addresses to any client, after powering up.

Could we use one of the buttons on these devices to issue a halt command? TP3020's WPS button would be perfect for that job, here is a description how to configure it with OpenWRT. And for all other devices, maybe we could have a hidden, configurable halt page such as piratebox.lan/haltbox

What I try to do now is to connect to the PirateBox with ssh and issue a "halt" command, before unplugging the power supply. But this is not always possible.

In case your FAT32 formatted USB/SD storage device gets damaged, you can recover most data with the following command on a Linux system (check first with the mount command, which is your external device):
sudo dosfsck -t -a -w /dev/sdb1

I ususally then get dozens of repair messages like:
/external_fs/E⌡√ⁿ81=z.`vÖ
File size is 3941767839 bytes, cluster chain length is 0 bytes.
Truncating file to 0 bytes.
/external_fs/FSCK0000.055
Start cluster beyond limit (607376788 > 996338). Truncating file.
/external_fs/FSCK0000.055
Re: Allow to unmount USB/SD storage before power off
April 20, 2016 07:40PM
Something like you describe would be very helpful yes, but currently we haven't setup anything like that.. :-(