IO error handling in xfs_repair

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

 



Hi,

I have a spinning disk with XFS that corrupted a sector containing some inodes.
Reading it always gave a IO error (ENODATA).

xfs_repair unfortunately couldn't handle this at all, running into this
gem:

         if (process_inode_chunk(mp, agno, num_inos, first_ino_rec,
                                ino_discovery, check_dups, extra_attr_check,
                                &bogus))  {
                        /* XXX - i/o error, we've got a problem */
                        abort();
         }

TBH I was a bit shocked that XFS repair doesn't handle IO errors.
Surely that's a common occurrence?

Anyways, what I ended up doing was to use strace to get the seek offset
of the bad sector and then write a little python program to clear the block
(which then likely got remapped, or simply rewritten on the medium),
and apart from a few lost inodes everything was fine.

It seems that xfs_repair should have an option to clear erroring blocks that
it encounters? I realize that this option could be dangerous, but in many cases
it would seem like the only way to recover.

Or at a minimum print the seek offset on an error so that it can be cleared manually.

-Andi





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux