Skip to content

Instantly share code, notes, and snippets.

@harshavardhana
Last active December 24, 2015 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harshavardhana/6747924 to your computer and use it in GitHub Desktop.
Save harshavardhana/6747924 to your computer and use it in GitHub Desktop.
GlusterFS GFID to File conversion based on inode number
#!/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
@lokeshreddy4u
Copy link

INODE=$(ls -i ${BRICK}/.glusterfs/${GFID:0:2}/${GFID:2:2}/${GFID} )

typo in line 5

@harshavardhana
Copy link
Author

Oh thank you @lokeshreddy4u - updated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment