xfs
[Top] [All Lists]

Re: UUIDs / stable identifiers for files and directories?

To: Nathan Scott <nathans@xxxxxxx>
Subject: Re: UUIDs / stable identifiers for files and directories?
From: Dean Roehrich <roehrich@xxxxxxx>
Date: Wed, 10 Nov 2004 17:14:17 -0600
Cc: wojtek@xxxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
[resending...had a bounce]

>From:  Nathan Scott <nathans@xxxxxxx>
>On Wed, Nov 10, 2004 at 05:52:57PM +0100, wojtek@xxxxxxxxxxxx wrote:
>> Hello,
>> 
>> Is it true that every file and directory has its own UUID? And if so: is it
>> accessible to user programs? Can it be made accessible?
>
>Hmm, if you mean UUID's like those described in libuuid(3), then
>no - each filesystem has a UUID, but not each file.  Each file has
>an inode number of course... and XFS does provide mechanisms to get
>to files and directories via inode number.

Each file does have a unique identifer, called a handle.  The handle is a
tuple containing (filesystem id, inode number, inode generation number).  So
while it's not a uuid, it is, however, unique.


>> We want to develop a system that would store part of its data in the
>> filesystem, and part in the database. It would be very convenient to have
>> an unique and stable (surviving backup -  restore, dump) filesystem object
>> identifiers, and also uid -> path, or open by uid functionality.

The handle won't be persistent across a dump/restore (as you can probably
guess, now that you know its contents).

You can put a unique identifier in an extended attribute and let xfsdump and
xfsrestore carry the extended attributes around for you.

Dean


<Prev in Thread] Current Thread [Next in Thread>