I am interested in relating the position of a file on disk and the I/O R/W performance characteristics associated with this position.

I have been able to find two benchmarks, but they are both for Windows (see images below). I would be interested in finding similar benchmarks for Linux with a view to running them on my own machines.

I would also be interested in knowing how one can find out the position of a given file (CHS - Cylinder, Head, Sector) on disk. I found this thread (and links within) interesting, but didn't tell me what I want to know.

Images from Windows benchmarks.

From here:

enter image description here

And here:

enter image description here

  • 3
    The CHS mapping are hardly true anymore, most disks have a block mapping and that's all. To find blocks you need a combination of stat (to find the inode) and then find that inode inside the groups dumped by dumpe2fs. – grochmal Jun 30 '16 at 23:58
  • Thanks for your input. Yes, the thread to which I linked explained that CHS was no longer completely applicable. "(Cylinder/Head/Sector) was used in the past for this. CHS addresses did (originally) map to actual, physical locations on disk platters". But surely a physical location on a disk still has a meaning? OK, I'll take a look at what stat and dumpe2fs can tell me. You couldn't run the commands on one of your files and give a quick outline of what the numbers mean? – Vérace Jul 1 '16 at 0:04
  • Just ran this: "[pol@localhost workbench]$ dumpe2fs ./mysql-workbench-community-6.3.7-1.fc23.x86_64.rpm dumpe2fs 1.42.8 (20-Jun-2013) dumpe2fs: Bad magic number in super-block while trying to open ./mysql-workbench-community-6.3.7-1.fc23.x86_64.rpm Couldn't find valid filesystem superblock. [pol@localhost workbench]$ " - that looks bad. I just took the first file to hand. I seem to get this on every file. – Vérace Jul 1 '16 at 0:06
  • heh, you run stat on a file but dumpe2fs must be run on a block device. First line in the man :) – grochmal Jul 1 '16 at 0:13
  • Thanks again - jumped the gun a bit! That's a lot of data - is there an "Dummy's Guide"? :-) – Vérace Jul 1 '16 at 0:19

To find the block address of a file, it is much more convenient to use the filefrag -v command, which works with commonly-used Linux filesystems these days (ext4, XFS, Btrfs, f2fs, etc.)

$ filefrag -v /boot/initramfs-3.10.0-327.13.1.el7_lustre.x86_64
Filesystem type is: ef53
File size of /boot/initramfs-3.10.0-327.13.1.el7_lustre.x86_64 is 21375560 (20875 blocks of 1024 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..   10239:      30721..     40960:  10240: 
   1:    10240..   16383:      43009..     49152:   6144:      40961:
   2:    16384..   20479:     198657..    202752:   4096:      49153:
   3:    20480..   20874:     196712..    197106:    395:     202753: last,eof
/boot/initramfs-3.10.0-327.13.1.el7_lustre.x86_64: 4 extents found

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.