[SOLVED] Redundance in partition record

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

[SOLVED] Redundance in partition record

Post by qw »

Hi everybody,

In a partition record, the start of a partition is stored twice: once as CHS at offset 1 and once as 32-bits LBA at offset 8. Is this redundance by design, or am I missing something?

Roel
Last edited by qw on Mon Jan 18, 2010 7:18 am, edited 1 time in total.
User avatar
zity
Member
Member
Posts: 99
Joined: Mon Jul 13, 2009 5:52 am
Location: Denmark

Re: Redundance in partition record

Post by zity »

No it is not due to redundancy. The CHS fields are not used anymore because all disks use LBA nowadays, and they are in some cases just set to zero. They only exists to preserve backward compatibility. CHS values max out at 8 GB, so they are not really useful anymore. There's an entry in the wiki about partition tables: http://wiki.osdev.org/Partition_Table
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Redundance in partition record

Post by qw »

Thanks Zity. I did read the Wiki (and some other pages on the net) but what my question came down to is: can I rely on the LBA to always be correct?

From Partition Table:
  • CHS fields "max out" on a drive that is approximately 8GB in size -- and are therefore useless on almost all current drives.
  • For drives smaller than 8GB, the LBA fields and the CHS fields must "match" when the values are converted into the other format.
  • For drives bigger than 8GB, generally the CHS fields are set to Cylinder = 1023, Head = 254 or 255, Sector = 63 -- which is considered an invalid setting.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Redundance in partition record

Post by thepowersgang »

For most drives you can, but if the size is less than 8 GiB, I would probably use the CHS values if the LBA values don't match, just because it may be a pre-LBA disk (although, I doubt there are any pre-LBA disks still around)
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Redundance in partition record

Post by qw »

Okay, thanks, that answers my question.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Redundance in partition record

Post by Owen »

thepowersgang wrote:For most drives you can, but if the size is less than 8 GiB, I would probably use the CHS values if the LBA values don't match, just because it may be a pre-LBA disk (although, I doubt there are any pre-LBA disks still around)
There are, but you're unlikely to come into contact with them. I have a Pre-ATA disk!
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: [SOLVED] Redundance in partition record

Post by ~ »

There are even ATA disks that can only use CHS, I think I have a 12GB laptop disk that always uses CHS versions of FAT filesystems, and some 400 or 800MB disks that use only CHS (also a 4GB laptop disk that supports LBA by default and have never seen it using CHS FAT filesystems).
Post Reply