ntfs block allocation policy

Hi there
Could some state what is the on disk block allocation policy of Win NTFS
for write :

  • Is it always going forward towards the end of the disk ?
  • If there is a read operation on a backward location on the disk , will it
    restart going forward from where it finished reading ?

Zvi Dubitzky
Storage Systems Technology Email: dubi@il.ibm.com
IBM Haifa Research Laboratory Phone: +972-4-8296182
Haifa, 31905, ISRAEL

Could some state what is the on disk block allocation policy of Win NTFS
for write :

  • Is it always going forward towards the end of the disk ooking for unused
    blocks?
  • If there is a read operation on a backward location on the disk , will
    ntfs restart going forward from where it finished reading ?

> - Is it always going forward towards the end of the disk ?

It tries to go forward from the current EOF of the file in question, if this
fails - then it goes forward from a wrapping-around “cluster hint”.

  • If there is a read operation on a backward location on the disk , will it
    restart going forward from where it finished reading ?

??? no for sure. Why read operations - and any current disk workload - must
influence the allocation policy?

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

Maxim,

What is this wrap around “cluster-hint” regarding the ntfs block alloc
policy ?

The last place where the block was allocated. It starts the scanning for
free blocks there, and sets the hint to the first free block after the
just-allocated run. If the hint hits the volume end - it is restarted from the
start.
For MFT, there is an area recommended for it. Usual file allocation try to
never use it, and use it only as a last resort.

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

----- Original Message -----
From: “Zvi Dubitzki”
To: “Windows File Systems Devs Interest List”
Sent: Wednesday, November 12, 2003 2:20 PM
Subject: [ntfsd] Re: ntfs block allocation policy

> Maxim,
>
> What is this wrap around “cluster-hint” regarding the ntfs block alloc
> policy ?
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Please do not assume an allocation strategy. While you are describing
the very basics of any rudimentary filesystem block allocator - attempt
to keep them contiguous - this goes without saying.

I am sure Zvi is not asking such a simple question. Therefore, I am also
pretty sure he wants to know the answer in sufficient detail that from
release to release that, knowing how it worked, he will be impacted if
someone comes up with a clever idea and reshapes the allocator in part
or in whole. This will, naturally, not be outside the realm of reason.

Otherwise, there are plenty of ways to watch the allocator in action
with judicious use of FSCTL_GET_RETRIEVAL_POINTERS and FSCTL_MOVE_FILE,
shifting around the clusters allocated to files to build an
understanding of how it might work in certain situations.

Dan Lovinger
Microsoft Corp.

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Wednesday, November 12, 2003 3:08 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Re: ntfs block allocation policy

The last place where the block was allocated. It starts the scanning
for
free blocks there, and sets the hint to the first free block after the
just-allocated run. If the hint hits the volume end - it is restarted
from the
start.
For MFT, there is an area recommended for it. Usual file allocation
try to
never use it, and use it only as a last resort.

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

----- Original Message -----
From: “Zvi Dubitzki”
To: “Windows File Systems Devs Interest List”
Sent: Wednesday, November 12, 2003 2:20 PM
Subject: [ntfsd] Re: ntfs block allocation policy

> Maxim,
>
> What is this wrap around “cluster-hint” regarding the ntfs block alloc
> policy ?
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


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