[Gluster-devel] How to resolve gfid (and .glusterfs symlink) for a deleted file

Pranith Kumar Karampuri pkarampu at redhat.com
Sat Nov 22 06:47:17 UTC 2014


On 11/22/2014 12:10 PM, Pranith Kumar Karampuri wrote:
>
> On 11/21/2014 09:50 PM, Ben England wrote:
>> Nux,
>>
>> Those thousands of entries all would match "-links 2" but not "-links 
>> 1"  The only entry in .glusterfs that would match is the entry where 
>> you deleted the file from the brick.  That's how hardlinks work - 
>> when you create a regular file, the link count is increased to 1 
>> (since the directory entry now references the inode), and when you 
>> create an additional hard link to the same file, the link count is 
>> increased to 2.   Try this with the "stat your-file" command and look 
>> at the link count, watch how it changes.  The "find" command that I 
>> gave you just tracks down the one hardlink that you want and nothing 
>> else.
> Does this filter out symlinks? because gfid-symlinks of directories 
> will have link-count 1. So may be the command should filter out symlinks?
Ah you gave '-type f'. Sorry missed that part :-)

Pranith
>
> Pranith
>>
>> -ben
>>
>> ----- Original Message -----
>>> From: "Nux!" <nux at li.nux.ro>
>>> To: "Ben England" <bengland at redhat.com>
>>> Cc: "Gluster Devel" <gluster-devel at gluster.org>
>>> Sent: Friday, November 21, 2014 11:03:46 AM
>>> Subject: Re: [Gluster-devel] How to resolve gfid (and .glusterfs 
>>> symlink) for a    deleted file
>>>
>>> Hi Ben,
>>>
>>> I have thousands of entries under /your/brick/directory/.glusterfs 
>>> .. find
>>> would return too many results.
>>> How do I find the one I'm looking for? :-)
>>>
>>> -- 
>>> Sent from the Delta quadrant using Borg technology!
>>>
>>> Nux!
>>> www.nux.ro
>>>
>>> ----- Original Message -----
>>>> From: "Ben England" <bengland at redhat.com>
>>>> To: "Nux!" <nux at li.nux.ro>
>>>> Cc: "Gluster Devel" <gluster-devel at gluster.org>
>>>> Sent: Friday, 21 November, 2014 16:00:40
>>>> Subject: Re: [Gluster-devel] How to resolve gfid (and .glusterfs 
>>>> symlink)
>>>> for a    deleted file
>>>> first of all, links in .glusterfs are HARD links not symlinks.   So 
>>>> the
>>>> file is
>>>> not actually deleted, since the local filesystem keeps a count of
>>>> references to
>>>> the inode and won't release the inode until the ref count reaches 
>>>> zero.   I
>>>> tried this, it turns out you can find it with
>>>>
>>>> # find /your/brick/directory/.glusterfs -links 1 -type f
>>>>
>>>> You use "type f" because it's a hard link to a file, and you don't 
>>>> want to
>>>> look
>>>> at directories or "." or ".." .  Once you find the link, you can 
>>>> copy the
>>>> file
>>>> off somewhere, and then delete the link.  At that point, regular 
>>>> self-heal
>>>> could repair it (i.e. just do "ls" on the file from a Gluster 
>>>> mountpoint).
>>>>
>>>> ----- Original Message -----
>>>>> From: "Nux!" <nux at li.nux.ro>
>>>>> To: "Gluster Devel" <gluster-devel at gluster.org>
>>>>> Sent: Friday, November 21, 2014 10:34:09 AM
>>>>> Subject: [Gluster-devel] How to resolve gfid (and .glusterfs 
>>>>> symlink) for
>>>>> a
>>>>>     deleted file
>>>>>
>>>>> Hi,
>>>>>
>>>>> I deleted a file by mistake in a brick. I never managed to find 
>>>>> out its
>>>>> gfid
>>>>> so now I have a rogue symlink in .glusterfs pointing to it (if I 
>>>>> got how
>>>>> it
>>>>> works).
>>>>> Any way I can discover which is this file and get rid of it?
>>>>>
>>>>> -- 
>>>>> Sent from the Delta quadrant using Borg technology!
>>>>>
>>>>> Nux!
>>>>> www.nux.ro
>>>>> _______________________________________________
>>>>> Gluster-devel mailing list
>>>>> Gluster-devel at gluster.org
>>>>> http://supercolony.gluster.org/mailman/listinfo/gluster-devel
>> _______________________________________________
>> Gluster-devel mailing list
>> Gluster-devel at gluster.org
>> http://supercolony.gluster.org/mailman/listinfo/gluster-devel
>
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at gluster.org
> http://supercolony.gluster.org/mailman/listinfo/gluster-devel



More information about the Gluster-devel mailing list