[Gluster-users] How to find Filename for given gfid ?

Daniel Mons daemons at kanuka.com.au
Fri Apr 26 12:17:11 UTC 2013


On 26 April 2013 19:39, Jörg Petersen <joerg.h.petersen at googlemail.com> wrote:
> Hello,
>
>    I have learnt (while investigating possible split-brain), that I get the
> corresponding gfid to any file by
> getfattr -n trusted.gfid --absolute-names -e hex $File
>
> But now I'd like to know, how to find the Filename for any given GFID?
> Otherwise it's impossible to figure out where the best data is?

I don't know if it's the best way, but here's how I do it:

I find the inode of the GFID (via "ls -li"), and then run a find with
the -inum flag to find the file on the brick.

Although a quick scan of the "find" manpage suggests you can use the
-samefile flag for the same effect.

It will definitely get you the right result, but it can be slow on a
very large brick (mine are 36TB each, which take a while to find
things sometimes).

-Dan



More information about the Gluster-users mailing list