Solved

Read Native Max LBA using C#

Posted on 2009-05-14
2
720 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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