From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ravi Pinjala Subject: Replacing corrupted files/directories Date: Thu, 2 Dec 2010 19:25:09 -0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 To: linux-btrfs@vger.kernel.org Return-path: List-ID: Is there a recommended way to replace a corrupted file or directory on btrfs? The use case I'm thinking of is handling filesystem corruption by restoring only the corrupted files from backup. For a corrupted file, it seems like deleting the file and replacing it with the copy from the backup works, but I don't know if this is necessarily the best way - the nature of copy-on-write means that there's still corrupt data lying around on the filesystem, right? And for directories, it's tricky, because (afaik) there's no way to delete a directory without first walking it; not good if it's corrupted. I think this is probably also relevant to something like Ceph or CRFS, where redundancy exists, but isn't managed by btrfs directly.