Proposal for Adding Heartbeat Monitoring Feature to Enhance Disk Safety on CasaOS
Opened this issue · 0 comments
Dear CasaOS Team,
I am writing to propose an enhancement aimed at improving the safety of disk drives within CasaOS, especially considering its intended deployment on older devices which may lack built-in UPS monitoring capabilities.
Given that disk integrity is paramount for any NAS operating system, I suggest implementing a heartbeat packet detection mechanism. This feature would involve the use of a custom-designed microcontroller responsible for monitoring the power supply status. In the event of a power failure, the microcontroller would cease sending heartbeat packets to CasaOS. After a predefined period without receiving these packets, CasaOS would automatically put the hard drives into a forced sleep state to prevent damage from abrupt power loss. Users should also be able to configure this timeout according to their UPS capacity.
Furthermore, if the heartbeat packets do not resume within the set time limit, CasaOS should initiate a controlled shutdown process to safeguard the system. However, if power is restored and the heartbeat packets resume before the system shuts down, CasaOS should allow the disks to spin up again upon the next access attempt.
It's worth noting that designing such a hardware component to monitor power continuity and send heartbeat packets is relatively straightforward. It can be achieved using readily available components and basic knowledge of electronics, making it accessible for enthusiasts and DIY users to create their own solutions. By providing documentation or guidelines for building this hardware, CasaOS could foster a community-driven approach to enhancing system reliability.
Implementing this feature would significantly enhance the reliability and safety of CasaOS installations on legacy hardware, providing users with peace of mind regarding their data security during unexpected power interruptions.
Thank you for considering this proposal. I look forward to discussing it further and contributing to its development if needed.
Best regards,
xue