1

I've created a RAID 5 device block by combining 4 HDDs.

The name of my device is md1.

But the /sys/block/md1/queue/scheduler file outputs "none" on doing cat.

And also after editing it using vim its throwing

/sys/devices/virtual/block/md1/queue/scheduler" E667: Fsync failed

I also tried using sysctl.conf and by adding

block.md1.queue.scheduler = deadline

But again it throws

error: "block.md1.queue.scheduler" is an unknown key

I'm really out of options. Please help me out.

5
  • Here be dragons! Feb 7, 2013 at 9:51
  • Which OS distribution/version/kernel are you using? That's a very pertinent detail!
    – ewwhite
    Feb 7, 2013 at 9:54
  • I'm using CentOS 6.3
    – Nilesh
    Feb 7, 2013 at 9:56
  • 2
    IIRC scheduling is set on the physical devices (sda/sdb/sdc...) not the md dev
    – symcbean
    Feb 7, 2013 at 10:07
  • @symcbean That thought came to my mind as well. But I was not sure about it that it can't be done.
    – Nilesh
    Feb 7, 2013 at 10:19

2 Answers 2

5

You can apply the I/O scheduler to the real block devices; e.g. your /dev/sdX devices or default a global append to the kernel boot command line in /etc/grub... (add elevator=deadline)

But since you're using EL6 (Red Hat, CentOS, etc.), the most effective approach would be to use the tuned framework.

In your situation,

yum install tuned tuned-utils

Then choose a profile which will provide the right setting for your application. For instance:

tuned-adm profile throughput-performance

or

tuned-adm profile enterprise-storage

Tuned chart

6
  • Thanks. I did it but still the scheduler file for RAID block outputs "none".
    – Nilesh
    Feb 7, 2013 at 10:14
  • @Nilesh What did you do?
    – ewwhite
    Feb 7, 2013 at 10:14
  • I installed and set the profile to throughput-performance and then checked the file /sys/block/md1/queue/scheduler
    – Nilesh
    Feb 7, 2013 at 10:16
  • Look at the output of when you run tuned-adm profile throughput-performance. It will say something like: Applying deadline elevator: sda sdb sdc sdd [ OK ]. As I stated in the answer above, the elevator settings are applied to your block devices... your individual disks, NOT the mdX device!
    – ewwhite
    Feb 7, 2013 at 10:18
  • Yeah that happened. And I cross checked the sdX scheduler file and they had that change.
    – Nilesh
    Feb 7, 2013 at 10:20
-1

print current scheduler for all physical disks

for d in $(find /sys -name scheduler | egrep '(/sd|/hd)'); do echo $d $(cat $d); done

cat /sys/devices/virtual/block/md1/queue/scheduler

[noop] deadline cfq

echo "deadline" > /sys/devices/virtual/block/md1/queue/scheduler

2
  • This might be somewhat useful, but it doesn't answer the question, and so it should be a comment. Also the explanation is insufficient (the title says "print", but the printing is done in the first line, the last one will modify scheduling). I won't downvote because nobody else mentioned the correct way to modify the scheduler (vim is not recommended).
    – Law29
    Dec 22, 2015 at 23:21
  • This doesn't work. As others have said, you need to perform this on the real physical devices, which you would have discovered if you had done the commands in reverse order. Always check your work. The echo in the last line is a no-op. Tested on RHEL7.7 using mdadm-4.1-1 and kernel 3.10.0-1062.
    – Mike S
    Jul 1, 2021 at 23:41

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.