Last active
December 24, 2015 04:59
-
-
Save harshavardhana/6747924 to your computer and use it in GitHub Desktop.
GlusterFS GFID to File conversion based on inode number
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
#!/bin/bash | |
BRICK=/path/to/brick | |
for i in $(grep 'split-brain' /var/log/glusterfs/glustershd.log | awk {'print $11'} | sort | uniq); do | |
GFID=$(echo $i | cut -f2 -d: | cut -f1 -d'>') | |
INODE=$(ls -i ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID} | awk {'print $1'}) | |
FILES=$(find ${BRICK} -inum ${INODE}) | |
echo ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID} | |
echo ${FILES} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
INODE=$(ls -i ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID} )
typo in line 5