How to get the Logical Block Number or alternative of a file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

How to get the Logical Block Number or alternative of a file

#1 Post by alan_b » 18 Jan 2014 05:52

I wish to obtain a list showing the order in which files are placed in a partition.

Defraggler can analyze a partition and give a grid display,
and when I select each block it will display a list of the files in that region of the partition,
but it cannot export that information as a list.
http://www.piriform.com/defraggler/builds

I would like to get a list of files showing their relative placement in the partition,
and wondered if there is a DOS command such as FSUTIL that could provide the L.B.N. (or Track/Sector) for the start of a file.
( I have looked at some documentation for FSUTIL and am afraid that I might regret the damage if I try the wrong options )

Regards
Alan

einstein1969
Expert
Posts: 960
Joined: 15 Jun 2012 13:16
Location: Italy, Rome

Re: How to get the Logical Block Number or alternative of a

#2 Post by einstein1969 » 18 Jan 2014 11:45

alan_b wrote:am afraid that I might regret the damage if I try the wrong options


the

Code: Select all

fsutil file queryallocranges


and

Code: Select all

fsutil volume querycluster


can be used together for resolve your issue. These are only read option and do not cause problem.

You may view the mydefrag project for utility that create a file fragmented and test/query LCN (logical cluster number).

Code: Select all

C:\Users\fra\Desktop\tmp>MyFragmenter.exe -i MyFragmenter.exe
MyFragmenter v1.2, 2008 J.C. Kessels

Commandline argument '-i' accepted.

Processing: MyFragmenter.exe
Fragment list:
  Extent 1: Lcn=460828, Vcn=0, NextVcn=4
  Extent 2: Lcn=943785, Vcn=4, NextVcn=12
  Extent 3: Lcn=973902, Vcn=12, NextVcn=20
  20 clusters, 3 fragments.

Finished, 1 files processed.


einstein1969

alan_b
Expert
Posts: 357
Joined: 04 Oct 2008 09:49

Re: How to get the Logical Block Number or alternative of a

#3 Post by alan_b » 18 Jan 2014 14:40

Many thanks for the advice.

I intend to explore and report back next week.

Regards
Alan

Post Reply