How to get Disk location

Hi,
I’m new to driver programming. Is there a way to identify free clusters physical location in the disk, particularly whether the free cluster is in which ring of the disk?
Appreciate your help.

-Sundar

And what will you do with the data once you get it? The problem here is
that you may have a “free cluster” at the time of the call to get the data,
but before you can do anything that is not the case. So what are you
trying to do, the answer makes a lot of difference.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

wrote in message news:xxxxx@ntfsd…
> Hi,
> I’m new to driver programming. Is there a way to identify free
> clusters physical location in the disk, particularly whether the free
> cluster is in which ring of the disk?
> Appreciate your help.
>
> -Sundar
>
>
> Information from ESET NOD32 Antivirus, version of virus
> signature database 4254 (20090717)

>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

Information from ESET NOD32 Antivirus, version of virus signature database 4254 (20090717)

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

> I’m new to driver programming. Is there a way to identify free clusters physical location in the disk,

FSCTL_GET_VOLUME_BITMAP

particularly whether the free cluster is in which ring of the disk?

What is “ring of the disk”?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

On top of the problem Don identifies, there’s another one that makes
your question meaningless. You can’t identify true physical sectors
as they map directly to a physical disk ring when the underlying disk
is RAID, SAN or other virtual storage.

So I too suggest you tell us what it is that you are really trying to achieve.

At 15:05 17/07/2009, Don Burn wrote:

And what will you do with the data once you get it? The problem here is
that you may have a “free cluster” at the time of the call to get the data,
but before you can do anything that is not the case. So what are you
trying to do, the answer makes a lot of difference.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

wrote in message news:xxxxx@ntfsd…
> > Hi,
> > I’m new to driver programming. Is there a way to identify free
> > clusters physical location in the disk, particularly whether the free
> > cluster is in which ring of the disk?
> > Appreciate your help.
> >
> > -Sundar
> >

i’m storing huge data and accessing through my s/w which is taking lot of time, i found that, some data can be retrieved faster and same size data takes time under same condition. my guess is, data stored in outer ring of the harddisk (near to head?) can be retrieved in short time compared to data stored away from head. if the above assumption is correct, for faster access, i’ve to store my data in the free cluster identifying closest to (physical location) where head can access faster or move the free clusters to the desired location(where head can be accessed faster or the data can be retrieved faster)

-Sundar

As I replied before, this sort of logic fails completely when the
disk concerned comes from RAID, SAN or other virtual storage.

If you need faster storage access for your application then consider
using RAID or RAID backed SAN/virtual storage. Several disks in RAID
0, RAID 10 or even RAID 50 will improve performance and in the latter
cases will add data protection if that is important to you.

Your current thinking, if actually feasible would require a lot of
work for actually very little positive gain. Other, robust solutions
to storage performance are out there and quite cheap.

At 17:58 18/07/2009, xxxxx@yahoo.com wrote:

i’m storing huge data and accessing through my s/w which is taking
lot of time, i found that, some data can be retrieved faster and
same size data takes time under same condition. my guess is, data
stored in outer ring of the harddisk (near to head?) can be
retrieved in short time compared to data stored away from head. if
the above assumption is correct, for faster access, i’ve to store my
data in the free cluster identifying closest to (physical location)
where head can access faster or move the free clusters to the
desired location(where head can be accessed faster or the data can
be retrieved faster)

-Sundar

In my understanding, Data retrieved in outer ring is retrieved faster
because of zones not because outer ring is near to head.

Shailesh Jain

On Sat, Jul 18, 2009 at 9:58 AM, wrote:

> i’m storing huge data and accessing through my s/w which is taking lot of
> time, i found that, some data can be retrieved faster and same size data
> takes time under same condition. my guess is, data stored in outer ring of
> the harddisk (near to head?) can be retrieved in short time compared to data
> stored away from head. if the above assumption is correct, for faster
> access, i’ve to store my data in the free cluster identifying closest to
> (physical location) where head can access faster or move the free clusters
> to the desired location(where head can be accessed faster or the data can be
> retrieved faster)
>
> -Sundar
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) 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
>

“Outer ring” is not a valid name for locations on the platter(s) of hard drives. There are several factors involved in the speed with which data on a ‘rust-based’ hard drive, even old floppies, is transferred. There is:

  1. How much cache memory is contained in the drive, controller, and operating system.
  2. What are the odds that the data being transferred is in the cache.
  3. Rotation speed of the media. 4200 RPM was the old notebook speed, 5400, 7200, 10K, and 15K are other speeds used in various hard drives.
  4. Seek time from current head location to where data being transferred is located.
  5. How many bad blocks on the hard drive where the firmware must seek to another location to find the logical sector that has been relocated to a spare sector.
  6. Is you transfer encountering any of the these bad blocks.
  7. How fast can the drive heads and electronics transfer data from the media.
  8. How fast can the drive transfer data from the controller to the drive or vice versa.
  9. How fast can the controller transfer data from/to memory.

In ZBR, zone bit recording, each zone contains more sectors per track as you move out from the center of the platter. I believe this is a patented technology, though there may have been some workarounds discovered over time. This allows the same number of bits to be transferred from/to the media in a specific amount of time regardless of where it is occurring on the platter. With the old fixed number of sectors per track of MFM and floppy days it took more time to transfer the data from the outer tracks than the inner ones.

If you want to access “huge data”, then you need to find the best hardware. Try SAS, Serial Attached SCSI, with 15K RPM drives in a stripping RAID configuration. Your ‘guess’ about ‘outer ring’ and ‘near to head’ is wrong. There is no relationship between the two except when the drive is being spun down and then the heads are usually, IIRC, placed near the inner tracks. Without confidential manufacturer information about specific hard drives you cannot determine the ‘real’ location for a specific sector and in fact, all the sectors that make up a single cluster may not be located together. The more a drive has been used the more likely this replacement of bad sectors with spares has occurred.

“shailesh jain” wrote in message news:xxxxx@ntfsd…
In my understanding, Data retrieved in outer ring is retrieved faster because of zones not because outer ring is near to head.

Shailesh Jain

On Sat, Jul 18, 2009 at 9:58 AM, wrote:

i’m storing huge data and accessing through my s/w which is taking lot of time, i found that, some data can be retrieved faster and same size data takes time under same condition. my guess is, data stored in outer ring of the harddisk (near to head?) can be retrieved in short time compared to data stored away from head. if the above assumption is correct, for faster access, i’ve to store my data in the free cluster identifying closest to (physical location) where head can access faster or move the free clusters to the desired location(where head can be accessed faster or the data can be retrieved faster)

-Sundar


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) 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

On Sat, Jul 18, 2009 at 3:03 PM, David Craig wrote:

> “Outer ring” is not a valid name for locations on the platter(s) of hard
> drives. There are several factors involved in the speed with which data on
> a ‘rust-based’ hard drive, even old floppies, is transferred. There is:
>
> 1. How much cache memory is contained in the drive, controller, and
> operating system.
> 2. What are the odds that the data being transferred is in the cache.
> 3. Rotation speed of the media. 4200 RPM was the old notebook speed,
> 5400, 7200, 10K, and 15K are other speeds used in various hard drives.
> 4. Seek time from current head location to where data being transferred is
> located.
> 5. How many bad blocks on the hard drive where the firmware must seek to
> another location to find the logical sector that has been relocated to a
> spare sector.
> 6. Is you transfer encountering any of the these bad blocks.
> 7. How fast can the drive heads and electronics transfer data from the
> media.
> 8. How fast can the drive transfer data from the controller to the drive
> or vice versa.
> 9. How fast can the controller transfer data from/to memory.
>
> In ZBR, zone bit recording, each zone contains more sectors per track as
> you move out from the center of the platter. I believe this is a patented
> technology, though there may have been some workarounds discovered over
> time. This allows the same number of bits to be transferred from/to the
> media in a specific amount of time regardless of where it is occurring on
> the platter.
>

I am not sure if I follow you here. Are you saying that Data transfer rate
will be same irrespective of what zone you are transferring from ? The
answer to that would be No.
Outer zones have more sectors/track than inner zones. If the disk is fixed
RPM, it will cover more sectors in outer zones than inner
zones, resulting in transferring more bits/sec. Thus, outer zones have
higher BW than inner zones.

> With the old fixed number of sectors per track of MFM and floppy days it
> took more time to transfer the data from the outer tracks than the inner
> ones.
>
> If you want to access “huge data”, then you need to find the best
> hardware. Try SAS, Serial Attached SCSI, with 15K RPM drives in a stripping
> RAID configuration.
>

How about Flash drives ? Expensive, huh ?

> Your ‘guess’ about ‘outer ring’ and ‘near to head’ is wrong. There is no
> relationship between the two except when the drive is being spun down and
> then the heads are usually, IIRC, placed near the inner tracks. Without
> confidential manufacturer information about specific hard drives you cannot
> determine the ‘real’ location for a specific sector and in fact, all the
> sectors that make up a single cluster may not be located together. The more
> a drive has been used the more likely this replacement of bad sectors with
> spares has occurred.
>
>
>
> “shailesh jain” wrote in message
> news:xxxxx@ntfsd…
> In my understanding, Data retrieved in outer ring is retrieved faster
> because of zones not because outer ring is near to head.
>
> Shailesh Jain
>
> On Sat, Jul 18, 2009 at 9:58 AM, wrote:
>
>> i’m storing huge data and accessing through my s/w which is taking lot of
>> time, i found that, some data can be retrieved faster and same size data
>> takes time under same condition. my guess is, data stored in outer ring of
>> the harddisk (near to head?) can be retrieved in short time compared to data
>> stored away from head. if the above assumption is correct, for faster
>> access, i’ve to store my data in the free cluster identifying closest to
>> (physical location) where head can access faster or move the free clusters
>> to the desired location(where head can be accessed faster or the data can be
>> retrieved faster)
>>
>> -Sundar
>>
>>
>> —
>> NTFSD is sponsored by OSR
>>
>> For our schedule of debugging and file system seminars
>> (including our new fs mini-filter seminar) 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
>>
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) 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
>

As David was trying to point out there are so many other factors in this
that the your sectors/track worry is not going to do any improvement. Since
you are asking about free sectors then you are using a file system so it has
costs and improvements thanks to caching etc. There are a ton of things
that can be done to get faster or better I/O performance, but what you are
asking for will not do it.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“shailesh jain” wrote in message
news:xxxxx@ntfsd…
> On Sat, Jul 18, 2009 at 3:03 PM, David Craig
> wrote:
>
>> “Outer ring” is not a valid name for locations on the platter(s) of hard
>> drives. There are several factors involved in the speed with which data
>> on
>> a ‘rust-based’ hard drive, even old floppies, is transferred. There is:
>>
>> 1. How much cache memory is contained in the drive, controller, and
>> operating system.
>> 2. What are the odds that the data being transferred is in the cache.
>> 3. Rotation speed of the media. 4200 RPM was the old notebook speed,
>> 5400, 7200, 10K, and 15K are other speeds used in various hard drives.
>> 4. Seek time from current head location to where data being transferred
>> is
>> located.
>> 5. How many bad blocks on the hard drive where the firmware must seek to
>> another location to find the logical sector that has been relocated to a
>> spare sector.
>> 6. Is you transfer encountering any of the these bad blocks.
>> 7. How fast can the drive heads and electronics transfer data from the
>> media.
>> 8. How fast can the drive transfer data from the controller to the drive
>> or vice versa.
>> 9. How fast can the controller transfer data from/to memory.
>>
>> In ZBR, zone bit recording, each zone contains more sectors per track as
>> you move out from the center of the platter. I believe this is a
>> patented
>> technology, though there may have been some workarounds discovered over
>> time. This allows the same number of bits to be transferred from/to the
>> media in a specific amount of time regardless of where it is occurring on
>> the platter.
>>
>
> I am not sure if I follow you here. Are you saying that Data transfer rate
> will be same irrespective of what zone you are transferring from ? The
> answer to that would be No.
> Outer zones have more sectors/track than inner zones. If the disk is fixed
> RPM, it will cover more sectors in outer zones than inner
> zones, resulting in transferring more bits/sec. Thus, outer zones have
> higher BW than inner zones.
>
>
>
>
>> With the old fixed number of sectors per track of MFM and floppy days
>> it
>> took more time to transfer the data from the outer tracks than the inner
>> ones.
>>
>> If you want to access “huge data”, then you need to find the best
>> hardware. Try SAS, Serial Attached SCSI, with 15K RPM drives in a
>> stripping
>> RAID configuration.
>>
>
> How about Flash drives ? Expensive, huh ?
>
>
>> Your ‘guess’ about ‘outer ring’ and ‘near to head’ is wrong. There is
>> no
>> relationship between the two except when the drive is being spun down and
>> then the heads are usually, IIRC, placed near the inner tracks. Without
>> confidential manufacturer information about specific hard drives you
>> cannot
>> determine the ‘real’ location for a specific sector and in fact, all the
>> sectors that make up a single cluster may not be located together. The
>> more
>> a drive has been used the more likely this replacement of bad sectors
>> with
>> spares has occurred.
>>
>>
>>
>> “shailesh jain” wrote in message
>> news:xxxxx@ntfsd…
>> In my understanding, Data retrieved in outer ring is retrieved faster
>> because of zones not because outer ring is near to head.
>>
>> Shailesh Jain
>>
>> On Sat, Jul 18, 2009 at 9:58 AM, wrote:
>>
>>> i’m storing huge data and accessing through my s/w which is taking lot
>>> of
>>> time, i found that, some data can be retrieved faster and same size data
>>> takes time under same condition. my guess is, data stored in outer ring
>>> of
>>> the harddisk (near to head?) can be retrieved in short time compared to
>>> data
>>> stored away from head. if the above assumption is correct, for faster
>>> access, i’ve to store my data in the free cluster identifying closest to
>>> (physical location) where head can access faster or move the free
>>> clusters
>>> to the desired location(where head can be accessed faster or the data
>>> can be
>>> retrieved faster)
>>>
>>> -Sundar
>>>
>>>
>>> —
>>> NTFSD is sponsored by OSR
>>>
>>> For our schedule of debugging and file system seminars
>>> (including our new fs mini-filter seminar) 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
>>>
>>
>>
>> —
>> NTFSD is sponsored by OSR
>>
>> For our schedule of debugging and file system seminars
>> (including our new fs mini-filter seminar) 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
>>
>
>
>
> Information from ESET NOD32 Antivirus, version of virus
> signature database 4257 (20090718)

>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>

Information from ESET NOD32 Antivirus, version of virus signature database 4257 (20090718)

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Thanks, Don.

As I was trying to point out to the OP with the simplistic view of storage,
just because one track has more data per revolution of the media does not
mean you can get more in or from memory in some time. Not only does other
factors as just because you think your data is in the outer zone and
contiguous does not mean it really is there. You have to know how to ask
the drive for the ‘real’ physical location of each sector and by the time
you did that, you would loose any speed improvement you hoped to gain.
Today’s drives have far more code running in the on drive controller than
you would think. Old SCSI drives were complex, but there is far more
involved today especially since densities have been pushed.

Bottom line:

USE SAS. USE RAID (the more drives, the faster until the bus is saturated).
Keep OS and data on separate physical drives and even controllers. You can
use SSD drives (the fastest ones) for the OS and/or data and then your limit
is the bus speed.

“Don Burn” wrote in message news:xxxxx@ntfsd…
> As David was trying to point out there are so many other factors in this
> that the your sectors/track worry is not going to do any improvement.
> Since you are asking about free sectors then you are using a file system
> so it has costs and improvements thanks to caching etc. There are a ton
> of things that can be done to get faster or better I/O performance, but
> what you are asking for will not do it.
>
>
> –
> Don Burn (MVP, Windows DKD)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
> “shailesh jain” wrote in message
> news:xxxxx@ntfsd…
>> On Sat, Jul 18, 2009 at 3:03 PM, David Craig
>> wrote:
>>
>>> “Outer ring” is not a valid name for locations on the platter(s) of
>>> hard
>>> drives. There are several factors involved in the speed with which data
>>> on
>>> a ‘rust-based’ hard drive, even old floppies, is transferred. There is:
>>>
>>> 1. How much cache memory is contained in the drive, controller, and
>>> operating system.
>>> 2. What are the odds that the data being transferred is in the cache.
>>> 3. Rotation speed of the media. 4200 RPM was the old notebook speed,
>>> 5400, 7200, 10K, and 15K are other speeds used in various hard drives.
>>> 4. Seek time from current head location to where data being transferred
>>> is
>>> located.
>>> 5. How many bad blocks on the hard drive where the firmware must seek
>>> to
>>> another location to find the logical sector that has been relocated to a
>>> spare sector.
>>> 6. Is you transfer encountering any of the these bad blocks.
>>> 7. How fast can the drive heads and electronics transfer data from the
>>> media.
>>> 8. How fast can the drive transfer data from the controller to the
>>> drive
>>> or vice versa.
>>> 9. How fast can the controller transfer data from/to memory.
>>>
>>> In ZBR, zone bit recording, each zone contains more sectors per track as
>>> you move out from the center of the platter. I believe this is a
>>> patented
>>> technology, though there may have been some workarounds discovered over
>>> time. This allows the same number of bits to be transferred from/to the
>>> media in a specific amount of time regardless of where it is occurring
>>> on
>>> the platter.
>>>
>>
>> I am not sure if I follow you here. Are you saying that Data transfer
>> rate
>> will be same irrespective of what zone you are transferring from ? The
>> answer to that would be No.
>> Outer zones have more sectors/track than inner zones. If the disk is
>> fixed
>> RPM, it will cover more sectors in outer zones than inner
>> zones, resulting in transferring more bits/sec. Thus, outer zones have
>> higher BW than inner zones.
>>
>>
>>
>>
>>> With the old fixed number of sectors per track of MFM and floppy days
>>> it
>>> took more time to transfer the data from the outer tracks than the inner
>>> ones.
>>>
>>> If you want to access “huge data”, then you need to find the best
>>> hardware. Try SAS, Serial Attached SCSI, with 15K RPM drives in a
>>> stripping
>>> RAID configuration.
>>>
>>
>> How about Flash drives ? Expensive, huh ?
>>
>>
>>> Your ‘guess’ about ‘outer ring’ and ‘near to head’ is wrong. There is
>>> no
>>> relationship between the two except when the drive is being spun down
>>> and
>>> then the heads are usually, IIRC, placed near the inner tracks. Without
>>> confidential manufacturer information about specific hard drives you
>>> cannot
>>> determine the ‘real’ location for a specific sector and in fact, all the
>>> sectors that make up a single cluster may not be located together. The
>>> more
>>> a drive has been used the more likely this replacement of bad sectors
>>> with
>>> spares has occurred.
>>>
>>>
>>>
>>> “shailesh jain” wrote in message
>>> news:xxxxx@ntfsd…
>>> In my understanding, Data retrieved in outer ring is retrieved faster
>>> because of zones not because outer ring is near to head.
>>>
>>> Shailesh Jain
>>>
>>> On Sat, Jul 18, 2009 at 9:58 AM, wrote:
>>>
>>>> i’m storing huge data and accessing through my s/w which is taking lot
>>>> of
>>>> time, i found that, some data can be retrieved faster and same size
>>>> data
>>>> takes time under same condition. my guess is, data stored in outer ring
>>>> of
>>>> the harddisk (near to head?) can be retrieved in short time compared to
>>>> data
>>>> stored away from head. if the above assumption is correct, for faster
>>>> access, i’ve to store my data in the free cluster identifying closest
>>>> to
>>>> (physical location) where head can access faster or move the free
>>>> clusters
>>>> to the desired location(where head can be accessed faster or the data
>>>> can be
>>>> retrieved faster)
>>>>
>>>> -Sundar
>>>>
>>>>
>>>> —
>>>> NTFSD is sponsored by OSR
>>>>
>>>> For our schedule of debugging and file system seminars
>>>> (including our new fs mini-filter seminar) 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
>>>>
>>>
>>>
>>> —
>>> NTFSD is sponsored by OSR
>>>
>>> For our schedule of debugging and file system seminars
>>> (including our new fs mini-filter seminar) 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
>>>
>>
>>
>>
>> Information from ESET NOD32 Antivirus, version of virus
>> signature database 4257 (20090718)

>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>
>
>
> Information from ESET NOD32 Antivirus, version of virus
> signature database 4257 (20090718)

>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
>
>

>zones, resulting in transferring more bits/sec. Thus, outer zones have higher BW than inner zones.

Correct. To use this feature, purchase the largest-possible current hard disk and only use the small partition at its start, wasting all of the rest of the “slow” space.

Then create a RAID of such partitions.

This is how at least some hi-perf disk arrays work.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com