title: How the disk geometry (C/H/S) was determined on the partition table of flash memory storage?
body: <p>I'm going to write a disk partition creator program for flash memory removable devices, mostly controlled by SCSI based I/O and accessed with LBA address. </p>
  
  <p>For reference, I'm researching the partition table on the SD cards that were partitioned and formatted by the disk utility of Ubuntu. </p>
  
  <p>I used the 'unit' command of 'parted' software in Linux to watch the parameters of the cards with CHS unit and byte unit.</p>
  
  <p>The following is for a 8GB sd card with 15122432 sectors of LBA:</p>
  
  <pre><code>pi@raspberrypi:~ $ sudo parted /dev/sda
  GNU Parted 3.2
  Using /dev/sda
  Welcome to GNU Parted! Type 'help' to view a list of commands.
  (parted) unit chs print
  Model: Generic CRM01 SD Reader (scsi)
  Disk /dev/sda: 1020,130,11
  Sector size (logical/physical): 512B/512B
  BIOS cylinder,head,sector geometry: 1020,239,62.  Each cylinder is 7587kB.
  Partition Table: msdos
  Disk Flags:
  
  Number  Start  End          Type     File system  Flags
   1      0,1,0  1019,238,61  primary  ext3
  
  (parted) unit b print
  Model: Generic CRM01 SD Reader (scsi)
  Disk /dev/sda: 7742685184B
  Sector size (logical/physical): 512B/512B
  Partition Table: msdos
  Disk Flags:
  
  Number  Start   End          Size         Type     File system  Flags
   1      31744B  7738552319B  7738520576B  primary  ext3
  </code></pre>
  
  <p>The following is for a 4GB sd card with 7585792 sectors of LBA:</p>
  
  <pre><code>(parted) unit chs print
  Model: Generic CRM01 SD Reader (scsi)
  Disk /dev/sda: 1019,71,29
  Sector size (logical/physical): 512B/512B
  BIOS cylinder,head,sector geometry: 1019,120,62.  Each cylinder is 3809kB.
  Partition Table: msdos
  Disk Flags:
  
  Number  Start  End          Type     File system  Flags
   1      0,1,0  1018,119,61  primary  ext3
  
  (parted) unit b print
  Model: Generic CRM01 SD Reader (scsi)
  Disk /dev/sda: 3883925504B
  Sector size (logical/physical): 512B/512B
  Partition Table: msdos
  Disk Flags:
  
  Number  Start   End          Size         Type     File system  Flags
   1      31744B  3881656319B  3881624576B  primary  ext3
  </code></pre>
  
  <p>From my observation, the disk geometry values (C/H/S) are different on different capacity SD card, and the geometry values are seem associated with the end CHS address of the end of the partition. It is seems like..</p>
  
  <p>The card with the partition which end CHS tuple is (c, h, s), which disk geometry will be (c + 1 / h + 1 / s + 1). Are they related?</p>
  
  <p>But how the values are determined? Does those depend on OS or file system? </p>