On 11Sep2018 15:11, Ranjan Maitra <maitra@xxxxxxxxx> wrote:
I wanted to mention that as I mentioned earlier, I used ddrescue and was able
to copy the drive. However, the old (source) drive was found to have a few
blocks that were bad. From what I understand from reading online, one can find
these files. However, my filesystems for these two drives are xfs but most of
the documentation is for other kinds of filesystems. How do I do this for xfs
filesystems?
There is also xfs_repair: will this utility find the affected files?
Short answer: I don't actually know. It may be more useful to run it against
the bad drive because if those blocks are file data blocks then on the bad
drive it _may_ register them as bad and report; on the new drive they may just
look like blocks of zero bytes because ddrescue will have filled them in.
However, you _also_ need to run it against the new drive, because if the bad
blocks were filesystem structure black (as opposed to file data blocks) then
your filesystem will be corrupt anyway.
This is one of the advantages of a file based copy instead of and image based
copy such as dd: if there are bad blocks within a file a file based copy will
report the bad file (because it couldn't read it, and it knows the name of the
file it is trying to copy). Also, the new drive will have a clean filesystem.
An image based copy will copy damaged data structures (or copy bad data blocks
as zeroed blocks).
By bad data structure I'm considering damage done to the filesystem metadata by
the drive failures. If these "rescued" blocks lie within the filesystem
structure data then your new filesystem will have damage: you _need_ to run
xfs_repair over it anyway.
With a file based copy you start with a _correct_ empty filesystem on the
target and add correct data to it.
XFS is stable against reboots and crashes on the whole, by maintaining its data
structures in a cohenrent fashion, and which is why its fsck command is a
compatability shell script which does some option parsing and then does nothing
because the "mount" journal replay does any repair.
However, "out of band" damage caused by a failing drive cannot be implicitly
repaired because the filesystem doesn't know about it. You need xfs_repair for
that.
The xfs_repair manual page ("man xfs_repair") is extensive and informative. Had
a read.
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