How to Retrieve LBAs?

Hi,
I want to intercept file operations on Win 7 such as read/write etc at kernel level so i am going?to develop a file system filter driver. Since the latest way to do it is mini filter drivers so i?will be using these. Let me know if this is the best option.

I need to retrieve Logical Block Address (LBA) when i intercept a request. So the questions are:

  • Can i do it using a mini filter driver? A mini filter driver sits between IO Manager and base?filesystem. Are LBAs available at this level or the filter driver needs to sit between file?system and the storage driver to get LBAs (do i need to develop lower level filter driver)?

  • How to retrieve LBAs?

I did some research prior to posting here but could not find answers related to LBAs. Thanks for?your help and pointers.

sarshah.

Hi,
You can develop a lower class disk filter driver to get LBA.

At 2011-03-15 14:34:57??“ali raza” wrote:>Hi,>I want to intercept file operations on Win 7 such as read/write etc at kernel level so i am going to develop a file system filter driver. Since the latest way to do it is mini filter drivers so i will be using these. Let me know if this is the best option.>>I need to retrieve Logical Block Address (LBA) when i intercept a request. So the questions are:>>- Can i do it using a mini filter driver? A mini filter driver sits between IO Manager and base filesystem. Are LBAs available at this level or the filter driver needs to sit between file system and the storage driver to get LBAs (do i need to develop lower level filter driver)?>>- How to retrieve LBAs?>>I did some research prior to posting here but could not find answers related to LBAs. Thanks for your help and pointers.>>sarshah.>>> >>—>NTFSD is sponsored by OSR>>For our schedule of debugging and file system seminars visit: >http://www.osr.com/seminars>>To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi,
You can develop a class disk lower filter driver to get LBA.

On Tue, Mar 15, 2011 at 2:34 PM, ali raza wrote:

> Hi,
> I want to intercept file operations on Win 7 such as read/write etc at
> kernel level so i am going to develop a file system filter driver. Since the
> latest way to do it is mini filter drivers so i will be using these. Let me
> know if this is the best option.
>
> I need to retrieve Logical Block Address (LBA) when i intercept a request.
> So the questions are:
>
> - Can i do it using a mini filter driver? A mini filter driver sits between
> IO Manager and base filesystem. Are LBAs available at this level or the
> filter driver needs to sit between file system and the storage driver to get
> LBAs (do i need to develop lower level filter driver)?
>
> - How to retrieve LBAs?
>
> I did some research prior to posting here but could not find answers
> related to LBAs. Thanks for your help and pointers.
>
> sarshah.
>
>
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>

Just to add my $0.02. You are aware that the LBA
is not really a definitive value and its
usefulness varies considerably based on the type of underlying storage.

For almost any RAID or SAN storage it is
impossible to relate the LBA in the CDB to a
physical sector. And in these days of SSD’s, the
wear levelling algorithms of an SSD make the LBA
value meaningless except to the lookup table in the controller.

Mark.

At 09:02 15/03/2011, greencg wrote:

Hi,
You can develop a lower class disk filter driver to get LBA.

At 2011-03-15 14:34:57??“ali raza”
wrote:>Hi,>I want to
>intercept file operations on Win 7 such as
>read/write etc at kernel level so i am going to
>develop a file system filter driver. Since the
>latest way to do it is mini filter drivers so i
>will be using these. Let me know if this is the
>best option.>>I need to retrieve Logical Block
>Address (LBA) when i intercept a request. So the
>questions are:>>- Can i do it using a mini
>filter driver? A mini filter driver sits between
>IO Manager and base filesystem. Are LBAs
>available at this level or the filter driver
>needs to sit between file system and the storage
>driver to get LBAs (do i need to develop lower
>level filter driver)?>>- How to retrieve
>LBAs?>>I did some research prior to posting here
>but could not find answers related to LBAs.
>Thanks for your help and pointers.>>sarshah.>>>

Thanks Gang and Mark for your response.

Mark: Thanks for the useful info. I was not aware of that. However, what i am trying to do is for a particular type of hardware (specific to the hardware model) so i guess it should not cause problems. Am i right? Or may be i will have to try it out to figure this.

Gang: From your response i am assuming that mini filters are not going to work for my purpose. Can you please update what framework is used to develop lower filter driver for disk class? Is it WDM or IFS? Is there a code sample around?

Thanks for your help everyone.
sarshah.

I have followed this example and reproduced it in user mode. Not sure how useful it would be to kernel mode. plus it looks to only be valid for NTFS:

http://www.wd-3.com/archive/luserland.htm

I looked that blast from the past, and I don’t wish to beat a dead equine,
as I think when that was written, the IFS Kit was still $$$, but wouldn’t
the FastFat source be the spec for the BPB? For that matter, would the
FastFat source also reveal some more detail about how the FSCTL works?
Still, a nice bit of reverse engineering!

Philip D. Barila??? (303) 776-1264

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Friday, March 18, 2011 3:14 PM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] How to Retrieve LBAs?

I have followed this example and reproduced it in user mode. Not sure how
useful it would be to kernel mode. plus it looks to only be valid for NTFS:

http://www.wd-3.com/archive/luserland.htm