Re: OT: finding damaged files on an XFS filesystem (Was Re: OT: fastest way to copy one drive to another)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 20Sep2018 21:31, Ranjan Maitra <maitra@xxxxxxxxx> wrote:
On Fri, 21 Sep 2018 12:12:26 +1000 Cameron Simpson <cs@xxxxxxxxxx> wrote:
On 20Sep2018 19:06, Ranjan Maitra <maitra@xxxxxxxxx> wrote:
>I am sorry to return to this, but I am still struggling to find out the answer
>to how to find files that had bad blocks in my old drive.
[...]
>ddrescue on the new disk found no problems, but I know there are affected >files (the source disk was over 95% full), and I would like to know what >those files are called.

See "man xfs_db". It looks like the "blockget -v -b block-number" command may
provide useful info.

Thanks very much for this information: it is very helpful.

I do know the bytes and can figure out the sectors that are damaged. But I can't figure out how that translates to the block number of an xfs filesystem. Is there any reference for how to do this?

I would presume that it counts from the start of the partition containing the file system. The xfs_db command "sb" consults the filesystem superblock and should tell you the block size (4KiB is typical I think).

So I would start by:

- find the start sector of the partition containing the filesystem (counting from zero); that is your base

- subtract that from the bad sector number; that should be the sector offset into the XFS partition

- divide by the number of sectors per block (eg 512 byte sectors and 4KiB blocks would mean 8 sectors per block); hopefully ddrescue tells you what sector size it is using

Look up that block with "blockget" and then see if the corresponding file seems to have corresponding damage in its data.

Disclaimer: I haven't tried this. But I can if you run into trouble, and I also know an XFS expert I might consult if we can't figure this out ourselves.

Cheers,
Cameron Simpson <cs@xxxxxxxxxx>
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux