?
Solved

Read Native Max LBA using C#

Posted on 2009-05-14
2
Medium Priority
?
726 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

764 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