我这里有个产品,基于 ARM Linux ,客户会经常断电。这个产品运行的时候也会经常写各种参数文件、记录日志。
应该如何选取文件系统?只要其经常断电的情况下,也不会出现文件系统损坏就行了。
1
yidinghe 181 天前 via Android 2
https://www.reddit.com/r/linux/s/3qA3EyiNsd
回答贴在下面: Actual file system engineer here. All modern file systems are power fail tolerant. The only one that is regularly used that isn't is FAT, or ext2 if you still use that. Now this just means your metadata will be consistent, any data that hasn't been written out to disk yet will be lost. ext3 will write all dirty data before it commits the journal every 5 seconds, so it is least likely to screw you, you will only lose the last 5 seconds worth of data. Ext4, btrfs and xfs all do this thing called delayed allocation, which means we avoid writing data until the last possible moment, so you could very well lose the last 5 minutes of data written but still have a consistent file system if your applications are not using fsync(). I know next to nothing about ZFS, but delayed allocation is a pretty universal file system feature so you can bet they do roughly the same thing, making them no better at being power fail tolerant than any other modern file system. The other thing about ZFS is that they do not have a fsck, so if you trust your ZFS file system developers to not make mistakes then go for it, but speaking as a file system developer, the kind of mistakes we make are never simple and easily recovered from. |
2
busier 180 天前 via iPhone
Squash + overlayfs
|
3
flynaj 180 天前 via Android
可以看看 openwrt 是怎么处理的,刷机的路由器随便怎么断电都没有问题。
|