On Wed, Apr 09, 2008 at 10:53:36PM +0200, Francis Moreau wrote:Many compact flash cards will report 16 heads, and 16 or 32 sectors per track. Compact flash can of course connect as an IDE drive, so they are worth supporting (I keep trying to get the grub guys to accept my patch to fix their code that also assumed all disks have 63 sectors per track if they use LBA, but which is false since compact flash also supports LBA even with smaller sizes). Simplest way to find out what geometry a disk pretents to have is to ask fdisk, and since the only use for the information is when creating partitions, then fdisk's opinion is really all that seems to matter. Of course partitions can start and end anywhere so the total size is actually all that really matters. For example: # fdisk -l /dev/hda Disk /dev/hda: 260 MB, 260571136 bytes 16 heads, 32 sectors/track, 994 cylinders Units = cylinders of 512 * 512 = 262144 bytes Device Boot Start End Blocks Id System /dev/hda1 1 40 10224 83 Linux /dev/hda2 41 80 10240 83 Linux /dev/hda3 81 994 233984 83 Linux So no assuming 255 and 63 is not a good idea. Large disks tend to do it since 255 heads and 63 sectors per track is the maximum supported, and hence allowed them to get as much space in each "cylinder". Why do you want to know what cylinder size the hard disk pretents to have? What use could it be? Harddisks have varying numbers of sectors per cylinder depending on how far out you are from the center of the disk, but since software used to expect a simple X head, Y tracks, Z sectors per track, they lie about it and pretend to have some number of each (usually 255 heads (as if), 63 sectors per track (not likely with todays densities), and thousands of cylinders), and even with all that added up it still works out to less than the actual size of a modern drive. All that matters on a modern drive is the total number of sectors since all access is done by requesting a specific sector number starting from the begining of the drive. Where it is physically located is none of software's business, and it may not even be adjacent to the sector with a number right next to the requested one due to defect management and various optimizations. -- Len Sorensen --
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Linus Torvalds | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| David Newall | Re: Slow DOWN, please!!! |
| Ian Campbell | Re: [PATCH] x86: Construct 32 bit boot time page tables in native format. |
| Matthias Scheler | Re: HEADS UP: timecounters (branch simonb-timecounters) merged into -current |
| Greg Troxel | Re: Interface to change NFS exports |
| Thor Lancelot Simon | metadata cache and memory fragmentation |
| YAMAMOTO Takashi | amap memory allocation |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| David Miller | [GIT]: Networking |
| Dushan Tcholich | Re: ksoftirqd high cpu load on kernels 2.6.24 to 2.6.27-rc1-mm1 |
