On 2019/6/30 上午2:50, Pierre Couderc wrote: > 1- Is there a summary of btrfs recommendations for maintenance ? > > I have read somewhere that  a monthly  btrfs scrub is recommended. Is > there somewhere a reference,  an "official" (or not...) guide of all  > that  is recommended ? I'd say scrub can tell you how bad your disks are. But at least, I'd recommend to do an offline check (btrfs check) and a scrub after every unclean shutdown. For the maintenance recommends, Zygo Blaxell should has a pretty good ideas on this topic. > > I am lost in the wiki... > > 2- Is there a repair guide ? I see all these commands restore, scrub, > rescue. Is there a guide of what to do when a disk has some errors ? The > man does not say when use some command... If you're doing scrub routinely, it should give your a more reliable early warning than SMART. Normally for bad disk(s), you could replace them in advance. E.g when the disk begins to have unrecoverable errors suddenly, it is a good time to replace it. If it's too late that the fs can't be mounted any more, my recommends are: 1. btrfs check --readonly and save the output Sent the output to the mail list for help. The mail list will provide much detailed solution to recover. 2. try to mount the fs RO and save the output Just like step 1. 3. Btrfs-restore if you have enough space The only generic and easy to use way to salvage data. The following methods are only for guys with some btrfs internal knowledge: - mount with usebackroot option - btrfs-find-root paired with btrfs check --chunk-root/--tree-root Both methods are mostly the same, trying to use old roots. Not reliable. - experimental kernel patches to skip extent tree at mount time Kernel equivalent for btrfs-restore. Needs to recompile at least btrfs kernel module. Only works for extent tree related corruption. Thanks, Qu > > Erros occurs fairly often on big disks... > > Thanks > > PC >