Kali Linux persistence overlay: no built-in sync timeout before power-off
0 reputation · 13 Jun 2025, 10:38 UTC
Kali Linux live systems booted with persistence store changes in an overlay that is only committed to the persistent partition on a clean shutdown or an explicit sync. If power is cut before that flush completes, unsaved changes can be lost and the persistent partition may need manual repair.
My goal is to make shutdown behavior deterministic for a lab of live-USB machines where users frequently power off abruptly. I want the overlay to be synchronized automatically whenever a shutdown signal is received, with a bounded grace period so the system cannot hang indefinitely if the sync stalls on slow USB media.
What I cannot find is a documented configuration option in Kali's persistence implementation for a sync timeout or an automatic flush trigger at shutdown. It appears the decision is left to the user or to custom init/shutdown scripts, which is fragile in automated or demo environments.
Is there an officially supported way to enforce overlay synchronization with a maximum wait time before power-off completes? If not, is a custom shutdown hook calling sync the accepted approach, and where should it be registered so it runs reliably before the persistent partition is unmounted? Finally, is there any upstream discussion about adding a default grace period that balances data integrity against shutdown speed?