public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: Victor Banon <banon.victor@gmail.com>
Cc: remi@georgianit.com, linux-btrfs@vger.kernel.org
Subject: Re: BTRFS errors following bad SATA connection
Date: Fri, 3 Jan 2025 18:45:49 +0500	[thread overview]
Message-ID: <20250103184549.78c383b0@nvm> (raw)
In-Reply-To: <032d71e6-954e-4fc6-bf43-18a6762d08b9@gmail.com>

On Fri, 3 Jan 2025 13:42:25 +0100
Victor Banon <banon.victor@gmail.com> wrote:

> Absolutely! But I'm a bit worried because I've already identified and 
> deleted thousands of files, and errors persisted, and new corrupted 
> files kept popping up. It's possible I've been doing it wrong, so I'll 
> give it a go.
> 
> How do I identify which 3900 files are mismatched so that I can delete 
> them?

One way that comes to mind:

find . -type f -not -exec cat "{}" > /dev/null \; -exec mv "{}" "{}.bad" \;

Then you just find or delete all files with the *.bad extension.

> > The problem is, it could be that the transid mismatch errors won't go away
> > even if you replace all the files, or you might not be able to do so. Attempt
> > to delete or otherwise manipulate some of them might fail with the same errors
> > in dmesg.
> So far I have had no issues deleting files, with the sole exception of 
> the file in the trash bin I mentioned above. I'm not sure what to do 
> about that one, apart from hoping it goes away if I fix everything else. 
> Do you have any advice?

If the trash bin would be in a subvolume, you could delete the subvolume. But
then that could put the FS into read-only again, and moreover, into a state
where it goes read-only each time shortly after mounting (as the cleaner
process tries to finish the job), with no way to solve that.

-- 
With respect,
Roman

  reply	other threads:[~2025-01-03 13:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9443ea9c-08dc-4d08-81a6-cb91940e791e@gmail.com>
2025-01-01 18:25 ` BTRFS errors following bad SATA connection Victor Banon
2025-01-01 23:40   ` remi
2025-01-02  9:32     ` Victor Banon
2025-01-02 13:33       ` Roman Mamedov
2025-01-02 13:40         ` Victor Banon
2025-01-03  8:21           ` Victor Banon
2025-01-03 12:09             ` Roman Mamedov
2025-01-03 12:42               ` Victor Banon
2025-01-03 13:45                 ` Roman Mamedov [this message]
2025-01-03 18:47                   ` Victor Banon
2025-01-03 21:04                     ` Roman Mamedov
2025-01-03 21:24                       ` Victor Banon
2025-01-04 13:57                         ` Roman Mamedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250103184549.78c383b0@nvm \
    --to=rm@romanrm.net \
    --cc=banon.victor@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=remi@georgianit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox