LBA on USB Drive

There's a fascinating thread on this site called SD card - boot sector. CHS being dead might explain why multiplying the Cyl/trk/sectors (CTS?) values on my 2GB flash card don't equate to the disksize as returned in IOCTL_DISK_GET_DRIVE_GEOMETRY_EX. Question:

I have 2 2GB USB cards, both formatted, purchased at different times. They have different CTS and disksize values returned by the IOCTL.

#1: 242 cyl, #2: 247 cyl. Is this a feature of manufacturing? Where are those magic values stored on the chip that cause the CHS and disksize to be returned. And is that changeable? Could I for instance change a 2GB card into a 1GB card by somehow modifying the (what I assume is) # of sectors available?

Thanks for any info !

Reply to
erict2000
Loading thread data ...

The size information is out-of-band but from what I've seen is usually stored on the main flash array. Different firmware revs in the drive controller, or different specific flash devices, or a different number of defective sectors, will cause the reported size to differ.

--
Lewin A.R.W. Edwards
Projects - http://www.zws.com/
Personal - http://www.larwe.com/



** Posted from http://www.teranews.com **
Reply to
Lewin A.R.W. Edwards

Cylinder and track are basically the same dimension here - the only difference is that strictly (and for a real disk) a track is on a single platter whereas cylinder is the corresponding track on all platters. Using Cylinder/Head/Sector is a complete specification and may give you better results in your calculations - the head identifies the platter.

As for changing the values, I had always assumed they were hardwired but I've never looked into it and will refer you to Lewin's post instead.

--
Andrew Smallshaw
andrews@sdf.lonestar.org
Reply to
Andrew Smallshaw

Op Thu, 21 Aug 2008 11:37:12 +0200 schreef Andrew Smallshaw :

and for two-sided platters it also identifies the top or bottom surface.

--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/
Reply to
Boudewijn Dijkstra

I believe the difference may be caused by bad sectors on the raw device. The devices are made oversized due to a number of expected defects in the device. In the final stage of manufacture the device is tested and bad sectors are remapped to "extra" good ones. The cylinder count may be a result of that process.

The map is flashed onto the device and then a special bit is set that prevents it ( and the size) from being able to change. Some flash devices support wear leveling and can remap bad sectors during normal use. AFAIK this information is not user accessible.

Scott

Reply to
Not Really Me

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.