On 2020-06-11 12:07, Strahil Nikolov wrote: > I always thought that 'sync' mount option is enough to avoid > corruption of the FS. Am I just "fooling" myself ?
As "sync" is the default...yes, I think you are. File systems are complicated. Making them work robustly is even more complicated. And the ways hardware (including power) fails is often difficult to comprehend from a high-level language standpoint ("I just wrote fifty bytes to the end of the file, what's the big deal?"). All things considered, FFS works amazingly well. Back to the OP's question -- I'm curious why he's having trouble I just don't have. The vast majority of the time, my firewalls and other OpenBSD systems just come back on their own without intervention. When I'm moving or otherwise maintaining an OpenBSD system, I often just yank the power cord and let the thing fsck itself on reboot. I'm not going to say it ALWAYS comes back without intervention, but I'd guess well over 90% of the time, they just come up without help.) So... I'd look at what's going on more than try to change the basic operation of OpenBSD. Why are you writing to disk so much that your file systems end up being trashed? Some ideas I'd try before making a Franken-system: * Log to another system over the network via syslog so less writing happens locally. * use the noatime mount option -- that reduces a lot of unneeded writes. * Faster disks -- How about a small SSD? They spend less time writing, and often have enough on-board capacitance to complete writes after a power interruption. * experiment with softdeps. Supposedly, it helps keep the /FILE SYSTEM/ consistent. My experience is it tends to truncate files on unexpected power-downs, but in MOST cases, I'd rather have a zero byte file that has obviously been mangled than one that looks ok. I almost always use softdeps, maybe that's why my systems almost always come back after a power interruption? I have no hard facts to back up any of those helping a system come up on its own after a impolite powerdown, but they all seem like they might. And I do most of them, and my results seem to be better than the OP's, so maybe? Nick.