-
-
Save neurocis/e1a37bf06fd3702c5900c3eebc7445e7 to your computer and use it in GitHub Desktop.
Btrfs corrupt file locator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
echo "Looking for failed csum inodes...." | |
inodes=`dmesg | grep 'csum failed' | grep ino | sed 's/^.*ino \([0-9]*\) .*$/\1/g' | sort -u` | |
for f in $inodes; do echo -e " $f"; done | |
echo "" | |
echo "Finding files from inodes..." | |
corruptfiles=`for i in $inodes; do find /mnt/cache -inum $i 2>/dev/null; done` | |
for f in $corruptfiles; do echo -e " $f"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment