NTFS MFT sequence no behavior after formatting

Hi

In Linux file system Inodes, the generation no is
time stamp based, means when the first time the inode
is used after formatting volume, time stamping is used
and all the next reuses, increment the same, please
correct me if I am wrong.

Now the similar thing in NTFS is FileId consisting
of 8 byte no, 2 byts for sequence no + 6 bytes for MFT
index. Now my question is, how NTFS File Id gurantees
to be unique across different invocations of
formatting.

Consider the case. I have a fresh NTFS vol. and I
create 1.txt which gets assigned MFT entry 0x1B, and
sequence no 1. Now I delete it, again create it, the
same index is reused with sequence no. 2 now. This is
as expected.

Now I format volume. Again create the first file
1.txt and I can see, using NTFS disk explorer tool
that the new entry is using Index no 0x1B, with
sequence no 1 again.

How can I get gurantee of the uniquness of the
file Id after formatting as it is in Linux because of
use of time stamp in Inode generation no. This case is
considered for a NFS server on Windows, which
generates File Handles based on File Id, but if this
is the case(say only single file created in a exported
folder) and if some client has mounted the share and
using the same file, then this client has the file
handle(file id) for this file. Now I format the volume
on server and create the same different file with
same set up again. This file will get same MFT index
no, and same sequence no ie. 1, and the client side
handle will perfectly map to this file, if client
tries to access the share,which ideally should not
happen because this is different file indeed.

I experimented with the volume creation and all
this stuff. Didnt use NFS server and client but all
other
things I did at volume level and saw this problem.

So how do I solve this, any pointers. Please guide.

Thanks
Mrunal


Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

I’ve never seen any guarantee that the 8-byte file id is unique among *all*
filesystems, only that it is unique within *one* filesystem.

You should concatenate the volume GUID or serial number with the 8-byte file
id to generate a globally-unique file id.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of mrunal gawade
Sent: Thursday, March 16, 2006 4:13 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] NTFS MFT sequence no behavior after formatting

Hi

In Linux file system Inodes, the generation no is time stamp based, means
when the first time the inode is used after formatting volume, time stamping
is used and all the next reuses, increment the same, please correct me if I
am wrong.

Now the similar thing in NTFS is FileId consisting of 8 byte no, 2 byts
for sequence no + 6 bytes for MFT index. Now my question is, how NTFS File
Id gurantees to be unique across different invocations of formatting.

Consider the case. I have a fresh NTFS vol. and I create 1.txt which gets
assigned MFT entry 0x1B, and sequence no 1. Now I delete it, again create
it, the same index is reused with sequence no. 2 now. This is as expected.

Now I format volume. Again create the first file 1.txt and I can see,
using NTFS disk explorer tool that the new entry is using Index no 0x1B,
with sequence no 1 again.

How can I get gurantee of the uniquness of the file Id after formatting
as it is in Linux because of use of time stamp in Inode generation no. This
case is considered for a NFS server on Windows, which generates File Handles
based on File Id, but if this is the case(say only single file created in a
exported
folder) and if some client has mounted the share and using the same file,
then this client has the file handle(file id) for this file. Now I format
the volume on server and create the same different file with same set up
again. This file will get same MFT index no, and same sequence no ie. 1, and
the client side handle will perfectly map to this file, if client tries to
access the share,which ideally should not happen because this is different
file indeed.

I experimented with the volume creation and all this stuff. Didnt use NFS
server and client but all other things I did at volume level and saw this
problem.

So how do I solve this, any pointers. Please guide.

Thanks
Mrunal


Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@stonestreetone.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi Arlie

Thanks. What you are talking is correct, I am
also doing the same thing, attaching Vol GUID to make
it unique across file systems, my question is not
this. Its about use of sequence no in file id across
two format sessions, as compared to generation no. in
Unix inode which uses time stamps to initialize
generation no after each format session. NTFS starts
every time with 0 for sequence no after each format
session. I have given example to illustrate my
problem, can you go through my problem again?

–Mrunal


Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

What are you trying to accomplish? If you’re formatting the filesystem, you
cannot make any guarantees about the MFT index; it’s determined by the NTFS
implementation, and the only assumptions you should make are that it’s 8
bytes, and that no two files within the same filesystem will have the same
ID at the same time. That’s all you get. You should not assume anything
about the structure of the file ID, such as monotonicity or bit fields
within it, or anything – you should treat it as opaque.

You already have a means to distinguish files on different volumes, so what
is it that you want to accomplish?

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of mrunal gawade
Sent: Friday, March 17, 2006 5:10 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] NTFS MFT sequence no behavior after formatting

Hi Arlie

Thanks. What you are talking is correct, I am also doing the same
thing, attaching Vol GUID to make it unique across file systems, my question
is not this. Its about use of sequence no in file id across two format
sessions, as compared to generation no. in Unix inode which uses time stamps
to initialize generation no after each format session. NTFS starts every
time with 0 for sequence no after each format session. I have given example
to illustrate my problem, can you go through my problem again?

–Mrunal


Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@stonestreetone.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> How can I get gurantee of the uniquness of the

file Id after formatting

You cannot do this in NTFS.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com