I am using juice4halt (a small super-capacitor UPS) on my Raspberry Pi, but I found out that the amount of time halt
is taking is too long, and so the system will poweroff because of undervoltage.
So my goal is to shutdown the system as fast as possible, best would be 5 seconds.
My idea is having a script that does this, that does save only the important stuff onto persistent storage:
sync
sudo service mysql stop
sync
halt -f
My questions are:
1) Is this safe? Will sync
wait until the changes are sync'ed, or will the sync be invoked, and halt -f
will interrupt it?
2) To debug/verify that everything works, is there a command that shows if there are buffers that have not been written to disk?
System: Linux ras3 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux