一个经常会意外断电的机器,如何选取文件系统? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
villivateur
1.56D
V2EX    问与答

一个经常会意外断电的机器,如何选取文件系统?

  •  
  •   villivateur 2024-06-14 10:55:21 +08:00 1073 次点击
    这是一个创建于 515 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我这里有个产品,基于 ARM Linux ,客户会经常断电。这个产品运行的时候也会经常写各种参数文件、记录日志。

    应该如何选取文件系统?只要其经常断电的情况下,也不会出现文件系统损坏就行了。

    3 条回复    2024-06-15 01:57:31 +08:00
    yidinghe
        1
    yidinghe  
       2024-06-14 11:02:44 +08:00 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.
    busier
        2
    busier  
       2024-06-14 21:42:15 +08:00 via iPhone
    Squash + overlayfs
    flynaj
        3
    flynaj  
       2024-06-15 01:57:31 +08:00 via Android
    可以看看 openwrt 是怎么处理的,刷机的路由器随便怎么断电都没有问题。
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     963 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 20:08 PVG 04:08 LAX 12:08 JFK 15:08
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86