Powering off the device when having an external filesystem mounted

I suppose the device cannot simply be switched off by its power switch when having an extroot space on an external usb device, or when having an external filesystem mounted for sharing it on the local network, right?
It's not so practical to ssh into the box just for launching the halt command, so I was thinking to attach an halt command to the wps button, which is the only available button on my TP-LINK TD-W8970, as described here:
Perhaps someone have other suggestions?
Thanks in advance for answering.

1 Like

It is not ideal, but usually it is okay to just power it off. But yes, if you can gracefully shut it down, that is preferred. The command "poweroff" will shut everything down gracefully, so you can do this by ssh or by attaching this as an action on the button. If you go with the button, I'd recommend a press-and-hold duration of at least a few seconds to prevent accidental shutdowns.

I often have filesystem corruption on my f2fs USB stick samba share if I changed files and forgot a controlled shutdown because I am powering off at night.

For me a software solution would be preferable because the router is at another floor. Would be a changend sync time of the samba daemon or the filesystem possible as workaround?