Ubuntu Bionic - Power down USB HDD before shutdown

Hi Fellow Members,
@tsangyoujun, @hyphop - Sorry to be a bother :relaxed:

I need to automatically unmount and power down the USB HDD when I hit the hardware switch for shutdown.
dev/sda is the HDD and dev/sda1 is the mounted volume.
Environment is Ubuntu bionic on VIM3.

Can someone try it for themselves and then suggest foolproof steps. I am familiar with linux and will be able to follow the suggested steps. Thank you in advance!


its depend from kernel version

next topic for example how to