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]

 



If you have the original disk and can mount the filesystem then do this:

create a script like this and call it say /dir/testcatfile:
cat $1 > /dev/null
RC=$?
if [ ${RC} != 0 ] ; then
  echo "$1 is corrupt"
fi

chmod +x /dir/testcatfile

Then do this:
find /tmp -type f  -exec /dir/testcatfile {} \;

each file it gets an io error on will print out a message.

This only works if you still have the original and can mount it as it
relies on the disk returning io errors on the original disk.

On Sat, Sep 22, 2018 at 9:20 AM Tony Nelson
<tonynelson@xxxxxxxxxxxxxxxxx> wrote:
>
> On 18-09-22 00:44:17, Ranjan Maitra wrote:
>   ...
> > Is this the right thing to do?
>
> Probably.  I expect the affected files to contain NULs, which you could
> search for.  Then you'd know that you have the correct files and where
> the damage is.
>
> --
> ____________________________________________________________________
> TonyN.:'                       <mailto:tonynelson@xxxxxxxxxxxxxxxxx>
>        '                              <http://www.georgeanelson.com/>
> _______________________________________________
> 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
_______________________________________________
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