I am trying to understand the math in how the VMFS LUN's are structured.
If I do a fdisk -lu and get the following output:
Disk /dev/sdg: 536.9 GB, 536952700928 bytes
255 heads, 63 sectors/track, 65280 cylinders, total 1048735744 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sdg1 128 1048723199 524361536 fb VMware VMFS
The math adds up when it comes to calculating the total disk size based on 1048735744 sectors output.
1048735744 * 512 = 536952700928 bytes. 536952700928 / 1024 /1024/1024 = 500gb LUN.
It states the total sectors as 1048735744.
I calculate the total sectors as heads * sectors * cylinders = 1048723200
Which is one more than the ending sector size.
Where is the difference between the 1048735744 and the 1048723200 be used? and how is the 1048735744 being calculated?
Since INT 0x13 interface supports drives of sizes up to about 528 MB (Physical CHS addressing), then to support larger disks was introduced in INT13h EXT, it uses 64-bit logical block addressing (LBA). The CHS Value in LBA mode are calculated. Take a look at LBA to CHS Translation
In your case
CYL = Trunc (1048735744 / (255 * 63)) = 65280
Since INT 0x13 interface supports drives of sizes up to about 528 MB (Physical CHS addressing), then to support larger disks was introduced in INT13h EXT, it uses 64-bit logical block addressing (LBA). The CHS Value in LBA mode are calculated. Take a look at LBA to CHS Translation
In your case
CYL = Trunc (1048735744 / (255 * 63)) = 65280