How To Protect A Linux Server Against Power Outages
Ext4 already has journaling built in.
BTRFS and ZFS use CoW (Copy On Write). These are basically different methods built into file systems that can help you not lose data or end up in a corrupted state really. There are likely ways that you can further tune ext4 to be even more resilient to power outages. That and whatever database you may be using. You may be able to tune them to be more resilient to power outages as well. So another thing would be to have more regular backups as well. Though you want that last point regardless of whether you're prone to power outages or not.
If anything one important thing is stuff like installing/patching/upgrading parts of your system... If apt
is rudely interrupted halfway it won't be pretty. So you might want to refrain from doing any kind system patching if you don't know when you might lose power as that can put you in a sticky situation. But for your normal workloads you should be fine in general if they're randomly killed I'd think. If they're mostly stateless anyways.
If they have a lot of sensitive state stuff then you might end up in a situation where parallel writes being interrupted could corrupt state in your application logic.
You could also use an immutable base system. So if power outages happen you don't have to worry about the base system getting messed up 'cuz it can't change anyways. And maybe store the application state (database files, etc) on a separate partition/fs so that if anything were to happen to it you aren't blocked from at least being able to boot back in and restore the system. People tend to do stuff like that by putting /var
on a completely separate partition. So that logs, databases, etc don't mess with the core system.
Congratulations @cyberevolution! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
Your next target is to reach 700 upvotes.
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP