File Unique Identifier

Hi All,

How does the FSD maintain Unique Identifier associated with the file?
Can we see this id from a file system filter driver ? Which IRP & Object
will contain this information?

Which FIleInformation class is associated with Unique Identifier ?

Thanks
Surendra

FileInternalInformation will get you the file ID from NTFS. FAT does not
support this. The ID itself is a combination of the MFT offset and the
reuse count. See the “Inside Windows 2K” book for more on this.

You can see it get queried and you will see IRP_MJ_CREATE requests to
open a file by ID, obviously.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of SurendraI
>Sent: Friday, July 26, 2002 12:31 PM
>To: File Systems Developers
>Subject: [ntfsd] File Unique Identifier
>
>Hi All,
>
>How does the FSD maintain Unique Identifier associated with the file?
>Can we see this id from a file system filter driver ? Which IRP &
Object
>will contain this information?
>
>Which FIleInformation class is associated with Unique Identifier ?
>
>Thanks
>Surendra
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%

FAT supports the file ID query. FAT won’t let you open a file by ID, but it will certainly let you query it. FAT synthesizes its ID differently than NTFS, and there is some question whether or not FAT’s ID’s are truly unique (This last bit is list hearsay.)

-----Original Message-----
From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
Sent: Friday, July 26, 2002 1:51 PM
To: File Systems Developers
Subject: [ntfsd] RE: File Unique Identifier

FileInternalInformation will get you the file ID from NTFS. FAT does not
support this. The ID itself is a combination of the MFT offset and the
reuse count. See the “Inside Windows 2K” book for more on this.

You can see it get queried and you will see IRP_MJ_CREATE requests to
open a file by ID, obviously.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of SurendraI
>Sent: Friday, July 26, 2002 12:31 PM
>To: File Systems Developers
>Subject: [ntfsd] File Unique Identifier
>
>Hi All,
>
>How does the FSD maintain Unique Identifier associated with the file?
>Can we see this id from a file system filter driver ? Which IRP &
Object
>will contain this information?
>
>Which FIleInformation class is associated with Unique Identifier ?
>
>Thanks
>Surendra
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%

Yes, you are correct, FAT will return you an ID but you can’t do
anything with it. Call it support if you want.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of Fuller, Rob
>Sent: Friday, July 26, 2002 12:58 PM
>To: File Systems Developers
>Subject: [ntfsd] RE: File Unique Identifier
>
>FAT supports the file ID query. FAT won’t let you open a file by ID,
but
>it will certainly let you query it. FAT synthesizes its ID
differently
>than NTFS, and there is some question whether or not FAT’s ID’s are
truly
>unique (This last bit is list hearsay.)
>
>-----Original Message-----
>From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
>Sent: Friday, July 26, 2002 1:51 PM
>To: File Systems Developers
>Subject: [ntfsd] RE: File Unique Identifier
>
>
>
>FileInternalInformation will get you the file ID from NTFS. FAT does
not
>support this. The ID itself is a combination of the MFT offset and the
>reuse count. See the “Inside Windows 2K” book for more on this.
>
>You can see it get queried and you will see IRP_MJ_CREATE requests to
>open a file by ID, obviously.
>
>Pete
>
>Peter Scott
>xxxxx@KernelDrivers.com
>http://www.KernelDrivers.com
>
>
>>>-----Original Message-----
>>>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>>>xxxxx@lists.osr.com] On Behalf Of SurendraI
>>>Sent: Friday, July 26, 2002 12:31 PM
>>>To: File Systems Developers
>>>Subject: [ntfsd] File Unique Identifier
>>>
>>>Hi All,
>>>
>>>How does the FSD maintain Unique Identifier associated with the
file?
>>>Can we see this id from a file system filter driver ? Which IRP &
>Object
>>>will contain this information?
>>>
>>>Which FIleInformation class is associated with Unique Identifier ?
>>>
>>>Thanks
>>>Surendra
>>>
>>>
>>>—
>>>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>>>To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@inin.com
>To unsubscribe send a blank email to %%email.unsub%%
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%

It is supported by FASTFAT

// The internal information used to identify the fcb/dcb on the
// volume is the cluster index of the file. For the root dcb
the
// index is zero which is already in the buffer
//

if (NodeType(Fcb) != FAT_NTC_ROOT_DCB) {

//
// Extract the data and fill in the non zero fields of the
output
// buffer. We use the logical offset of the dirent
describing
// this file on the volume.
//

Buffer->IndexNumber.LowPart =
( NodeType(Fcb->ParentDcb) != FAT_NTC_ROOT_DCB ?
FatGetLboFromIndex( Fcb->Vcb,
Fcb->ParentDcb->FirstClusterOfFile
) :
Fcb->Vcb->AllocationSupport.RootDirectoryLbo ) +
Fcb->DirentOffsetWithinDirectory;
}

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Scott
Sent: Friday, July 26, 2002 11:51 AM
To: File Systems Developers
Subject: [ntfsd] RE: File Unique Identifier

FileInternalInformation will get you the file ID from NTFS. FAT does not
support this. The ID itself is a combination of the MFT offset and the
reuse count. See the “Inside Windows 2K” book for more on this.

You can see it get queried and you will see IRP_MJ_CREATE requests to
open a file by ID, obviously.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of SurendraI
>Sent: Friday, July 26, 2002 12:31 PM
>To: File Systems Developers
>Subject: [ntfsd] File Unique Identifier
>
>Hi All,
>
>How does the FSD maintain Unique Identifier associated with the file?
>Can we see this id from a file system filter driver ? Which IRP &
Object
>will contain this information?
>
>Which FIleInformation class is associated with Unique Identifier ?
>
>Thanks
>Surendra
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

Well, NTFS id’s are as unique as FAT. FAT uses the files starting
cluster number and NTFS uses the MFT entry number. If you delete a file
and add a new one, the ID will be the same as the old one if it uses the
same MFT entry that was just deleted; same with FAT with respect to the
cluster number.

None of these IDs are unique across different volumes.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Fuller, Rob
Sent: Friday, July 26, 2002 11:58 AM
To: File Systems Developers
Subject: [ntfsd] RE: File Unique Identifier

FAT supports the file ID query. FAT won’t let you open a file by ID,
but it will certainly let you query it. FAT synthesizes its ID
differently than NTFS, and there is some question whether or not FAT’s
ID’s are truly unique (This last bit is list hearsay.)

-----Original Message-----
From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
Sent: Friday, July 26, 2002 1:51 PM
To: File Systems Developers
Subject: [ntfsd] RE: File Unique Identifier

FileInternalInformation will get you the file ID from NTFS. FAT does not
support this. The ID itself is a combination of the MFT offset and the
reuse count. See the “Inside Windows 2K” book for more on this.

You can see it get queried and you will see IRP_MJ_CREATE requests to
open a file by ID, obviously.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of SurendraI
>Sent: Friday, July 26, 2002 12:31 PM
>To: File Systems Developers
>Subject: [ntfsd] File Unique Identifier
>
>Hi All,
>
>How does the FSD maintain Unique Identifier associated with the file?
>Can we see this id from a file system filter driver ? Which IRP &
Object
>will contain this information?
>
>Which FIleInformation class is associated with Unique Identifier ?
>
>Thanks
>Surendra
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

I can think of plenty to do with a unique file ID that doesn’t involve using it to open the file. However, if the ID is not in fact unique, you have a good point :slight_smile:

-----Original Message-----
From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
Sent: Friday, July 26, 2002 2:20 PM
To: File Systems Developers
Subject: [ntfsd] RE: File Unique Identifier

Yes, you are correct, FAT will return you an ID but you can’t do
anything with it. Call it support if you want.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of Fuller, Rob
>Sent: Friday, July 26, 2002 12:58 PM
>To: File Systems Developers
>Subject: [ntfsd] RE: File Unique Identifier
>
>FAT supports the file ID query. FAT won’t let you open a file by ID,
but
>it will certainly let you query it. FAT synthesizes its ID
differently
>than NTFS, and there is some question whether or not FAT’s ID’s are
truly
>unique (This last bit is list hearsay.)
>
>-----Original Message-----
>From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
>Sent: Friday, July 26, 2002 1:51 PM
>To: File Systems Developers
>Subject: [ntfsd] RE: File Unique Identifier
>
>
>
>FileInternalInformation will get you the file ID from NTFS. FAT does
not
>support this. The ID itself is a combination of the MFT offset and the
>reuse count. See the “Inside Windows 2K” book for more on this.
>
>You can see it get queried and you will see IRP_MJ_CREATE requests to
>open a file by ID, obviously.
>
>Pete
>
>Peter Scott
>xxxxx@KernelDrivers.com
>http://www.KernelDrivers.com
>
>
>>>-----Original Message-----
>>>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>>>xxxxx@lists.osr.com] On Behalf Of SurendraI
>>>Sent: Friday, July 26, 2002 12:31 PM
>>>To: File Systems Developers
>>>Subject: [ntfsd] File Unique Identifier
>>>
>>>Hi All,
>>>
>>>How does the FSD maintain Unique Identifier associated with the
file?
>>>Can we see this id from a file system filter driver ? Which IRP &
>Object
>>>will contain this information?
>>>
>>>Which FIleInformation class is associated with Unique Identifier ?
>>>
>>>Thanks
>>>Surendra
>>>
>>>
>>>—
>>>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>>>To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@inin.com
>To unsubscribe send a blank email to %%email.unsub%%
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%

Actually the NTFS file ID has a sequence number in the high 16 bits that
is incremented when the MFT record is reused. That makes it 65536 times
as unique as FAT’s file id :slight_smile:

The biggest issue with FAT’s file id is not that it is not unique, but
that it is not immutable. If you defrag your disk, the file ids change.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jamey Kirby
Sent: Friday, July 26, 2002 1:26 PM
To: File Systems Developers
Subject: [ntfsd] RE: File Unique Identifier

Well, NTFS id’s are as unique as FAT. FAT uses the files starting
cluster number and NTFS uses the MFT entry number. If you delete a file
and add a new one, the ID will be the same as the old one if it uses the
same MFT entry that was just deleted; same with FAT with respect to the
cluster number.

None of these IDs are unique across different volumes.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Fuller, Rob
Sent: Friday, July 26, 2002 11:58 AM
To: File Systems Developers
Subject: [ntfsd] RE: File Unique Identifier

FAT supports the file ID query. FAT won’t let you open a file by ID,
but it will certainly let you query it. FAT synthesizes its ID
differently than NTFS, and there is some question whether or not FAT’s
ID’s are truly unique (This last bit is list hearsay.)

-----Original Message-----
From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
Sent: Friday, July 26, 2002 1:51 PM
To: File Systems Developers
Subject: [ntfsd] RE: File Unique Identifier

FileInternalInformation will get you the file ID from NTFS. FAT does not
support this. The ID itself is a combination of the MFT offset and the
reuse count. See the “Inside Windows 2K” book for more on this.

You can see it get queried and you will see IRP_MJ_CREATE requests to
open a file by ID, obviously.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of SurendraI
>Sent: Friday, July 26, 2002 12:31 PM
>To: File Systems Developers
>Subject: [ntfsd] File Unique Identifier
>
>Hi All,
>
>How does the FSD maintain Unique Identifier associated with the file?
>Can we see this id from a file system filter driver ? Which IRP &
Object
>will contain this information?
>
>Which FIleInformation class is associated with Unique Identifier ?
>
>Thanks
>Surendra
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com To
>unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com To
unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To
unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@privtek.com
To unsubscribe send a blank email to %%email.unsub%%

> Well, NTFS id’s are as unique as FAT. FAT uses the files starting

cluster number and NTFS uses the MFT entry number. If you delete a
file
and add a new one, the ID will be the same as the old one if it uses
the
same MFT entry that was just deleted; same with FAT with respect to
the

No, NTFS’s IDs contain a generation number and thus will not repeat on
MFT entry reuse.

Max