LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-24-2021, 11:45 PM   #1
remm
LQ Newbie
 
Registered: Aug 2010
Posts: 4

Rep: Reputation: 0
BTRFS: How to map bad block at partition level into path of file using it?


There are 3 bad sectors on my drive. I know the exact block at the physical drive, and partition levels. I know these are bad, because ddrescue mapped them, and this has been verified by trying to read them via dd. Smart also shows the 3 blocks are bad and marked for relocation on the next write and this is the correct number. For ext4 there is a procedure to take this and figure out what file is using the block. I'm using BTRFS for this partition though. So is there a similar procedure? I also have a few NOCOW files so checksumming is not definitive here. Other ideas? Where I want to get to is to identify the corrupted files and to restore those from backup.

I have tried using "btrfs inspect-internal dump-tree -b ..." which seems like it might do something with a block number, but I don't think I know what kind of block address it wants or what it does, so no success there. I've also tried using "btrfs check --check-data-csum" to see if this would find anything. That said things are good though I did get some console and system log messages showing IO errors and as I said before since I have some NOCOW files it's not definitive in any case. I've avoided doing "btrfs scrub" for now because I don't want to modify the file system... or maybe I should use that...not sure if I can or not without changing the file system. Now I'm actually planning on trying to read every file with "dd" and see if I get an error return on any one of those reads... not sure if that will show anything.

So ideas on what direction to take? Or is there a better forum for this sort of question?

Thanks,
remm
 
Old 03-25-2021, 12:03 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
One would imagine you're likely to get a more authoritative answer from the folks on the btrfs list. The wiki suggests asking on IRC.
 
  


Reply

Tags
badblocks, btrfs, recovery, rescue



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] docker on btrfs using much space in /var/lib/docker/btrfs taumeister Linux - Containers 2 01-25-2018 04:13 PM
LXer: Rollback To A Working State With btrfs + apt-btrfs-snapshot On Ubuntu 12.10 LXer Syndicated Linux News 0 11-25-2012 10:42 AM
ext4 vs btrfs, and with btrfs do I still need to use LVM? blue_k Linux - Software 4 08-17-2012 11:31 PM
"Partition map has no partition map entry!" aquaboot Debian 3 01-09-2007 06:52 AM
emacs in run level 3 then switch to X (level 7) then back to level 3 dsoliver Slackware 3 09-01-2006 03:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration