First of all, i want to say that i think this is not a hardware issue,
the hard drive sounds fine and it didn't show any signs of slowness,
it's also not very old, got it the 10th of January.
The entire disk is behind luks encryption:
```
#lsblk
sdc 8:32 0 3.6T 0 disk
└─storage 254:1 0 3.6T 0 crypt
```
Recently i've been having some issues where the drive suddenly becomes
unreadable (seems to be caused by kited) but all of the times it
happened, using `xfs_repair` with the following syntax `sudo xfs_repair
/dev/mapper/storage -v`; made the drive readable again, but this time i
didn't have this luck, and the drive was unable to be repaired, leading
to this error at the end:
```
Phase 6 - check inode connectivity...
- resetting contents of realtime bitmap and summary inodes
- traversing filesystem ...
- agno = 0
bad hash table for directory inode 128 (no data entry): rebuilding
rebuilding directory inode 128
Invalid inode number 0x0
Metadata corruption detected at 0x56135ef283e8, inode 0x84 data fork
fatal error -- couldn't map inode 132, err = 117
```
I ran `xfs_db` to see what was happening on that inode:
`sudo xfs_db -x -c 'blockget inode 132' /dev/mapper/storage > xfs_db.log`
and this are the outputs:
- stderr:
```
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b275ab8/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b2d32e0/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b338de0/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b38ead0/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b3e9750/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b4383b0/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b47c868/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b547748/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b619828/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b63b9d8/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x1b687f38/0x1000
Metadata CRC error detected at 0x557ecac7bc85, xfs_cntbt block
0x1b8d1230/0x1000
Metadata CRC error detected at 0x557ecac7bc85, xfs_cntbt block
0x1b8d1290/0x1000
Metadata corruption detected at 0x557ecacb369b, xfs_refcountbt block
0x1b227dd8/0x1000
Metadata corruption detected at 0x557ecacb0600, xfs_inobt block
0x1afb5e68/0x1000
Metadata corruption detected at 0x557ecacb0600, xfs_finobt block
0x1afe9ef0/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x8b928790/0x1000
Metadata corruption detected at 0x557ecacb369b, xfs_refcountbt block
0x8b928780/0x1000
Metadata corruption detected at 0x557ecacb0600, xfs_inobt block
0x8b928310/0x1000
Metadata corruption detected at 0x557ecacb0600, xfs_finobt block
0x8b928468/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x11660d9e8/0x1000
Metadata corruption detected at 0x557ecacb369b, xfs_refcountbt block
0x1166000a0/0x1000
Metadata corruption detected at 0x557ecacb0600, xfs_inobt block
0x116531ea8/0x1000
Metadata corruption detected at 0x557ecacb0600, xfs_finobt block
0x116531ed0/0x1000
Metadata corruption detected at 0x557ecac7bbfd, xfs_bnobt block
0x176489440/0x1000
Metadata corruption detected at 0x557ecacb369b, xfs_refcountbt block
0x17603e178/0x1000
Metadata corruption detected at 0x557ecacb0600, xfs_inobt block
0x1760313d0/0x1000
Metadata corruption detected at 0x557ecacb0600, xfs_finobt block
0x176031920/0x1000
```
- stdout:
It's a 14GB file, i will not send it.
Help trying to recover the data (move it to another drive) would be great.
ideally i would fix the error, and i would move the data to another
drive, shrink the partition, make a new partition with EXT4 instead of
XFS, and move the data to the new partition, shrink, expand, and keep
doing that until everything is moved to EXT4 or some other file system,
or XFS again without whole drive encryption; i think this issues are
occurring because using luks on XFS is not a common thing, so it's
probably untested and unstable.
http://xfs.9218.n7.nabble.com/Assert-in-xfs-repair-Phase-7-and-other-xfs-restore-problems-td33368.html
I have found a possible solution for this problem in this mailing list.
The solution looks to be to clear the corrupted inode (132)
but i'm unable to find a way to do this while the drive is unmounted. Is
this possible? if so, how?
https://forums.unraid.net/topic/66749-xfs-file-system-corruption-safest-way-to-fix/
I have also found this post on the unraid forums about the same error,
(where i also found this email address), and the solution was the use a
way older version of xfs_repair, but sadly that solution didn't work
(probably because it's way too old?); Can you also confirm that the
issue is fixed on xfs_repair xfs_repair version 5.8.0?