Blockdev vs /sys/block/

Hello,

I want to set/get the read-ahead for my disks and there is a little issue that confuses me. There are three ways to get/set the read-ahead buffer:

  1. cat /sys/block/md0/bdi/read_ahead_kb
  2. cat /sys/block/md0/queue/read_ahead_kb
  3. blockdev --getra /dev/md0

Which one is the correct one? The first two gives me a value of 128. The last one gives me a value of 256. Where does this difference come from?

Well I dont have much linux knowldge, but since you are talking disks, the same philosophy should apply:
First two give you a value of 128 (kb)
The last, blockdev since to talk like ioctl etc... and so is in blocks ( of 512 bytes) 256 block of 512 bytes...
To me then the values are much the same

1 Like

Well... it makes sense, now :smiley:

Thank you for your answer, vbe!