Solved

Read Native Max LBA using C#

Posted on 2009-05-14
2
722 Views
Last Modified: 2012-05-07
I'm trying to figure out how to read in the native max LBA using C#.  For example, if someone changes the max LBA of a drive, I want to be able to read the original max LBA set by the manufacturer of the drive.  Can anybody help me with this, or point me in the right direction?

Thanks in advance!
0
Comment
Question by:dev117
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24449421
there are basically two kinds of LBA: 28 bit and 48 bit. Whether a drive supports either of those, depends on the drive's driver and sometimes BIOS settings. In older windows versions, the ATAPI driver had a setting for either of those, and it needs to be enabled to allow large LBA. Info on how to check and how to change that is here: http://support.microsoft.com/kb/303013

In the event you mean what the largest LBA number is that a drive allows, you can do a little calculation based on the absolute size of the drive. The sector size is usually 512 bytes on modern windows systems (you can check to be sure). The maximum LBA sector number is then essentially equal to the absolute size divided by 512.

In the event you mean to find what the maximum size can be of a drive when 28-bit or 48-bit LBA is on, it is simple. 28-bit can do 2^28 * 512 = 137,438,953,472, or 128 GB. 48-bit LBA can do 2^48 * 512 = 144,115,188,075,855,872 or 134,217,728 GB or 128 PB (petabytes).

-- Abel --
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24449467
In addition, this may be of help to get the real size of a physical drive (the middle section in my post) which was also used to get the LBA size. It is in VB6 code, if you need help translating it to C# let me know: http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_22825938.html
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question