Fedora Systemd – Changing the I/O Scheduler for a Specific Disk

fedoraiosystemd

I would like to change permanently the I/O scheduler for a specific disk on Fedora 20. According to what I have found, this can be achieved by executing the following shell line as root:

echo {SCHEDULER-NAME} > /sys/block/{DEVICE-NAME}/queue/scheduler

However, the change is lost after a reboot. It seems that a mean to achieve what I want is to create a systemd service but I am completely lost since it has to be executed after disks are mounted. Could someone help me to write such a systemd service ? Any other viable solution is also welcome.

Best Answer

The tuned and tuned-utils pacakages are available for Fedora (they are also in Red Hat). This is a system service that can apply predefined or user-defined system profiles and tuneables on-the-fly, including mount options, disk schedulers, sysctl parameters, etc. Many Liinux admins overlook these settings.

See the Fedora 20 Manual:
http://docs.fedoraproject.org/en-US/Fedora/20/html/Power_Management_Guide/sect-tuned-installation-and-usage.html

Something like:

tuned-adm profile virtual-guest

or

tuned-adm profile enterprise-storage

Here's the schedule of settings for RHEL. Fedora may be slightly different.

enter image description here

I know you're looking for settings on a specific disk, but I tend to apply the I/O scheduling parameters to all of the disks. Either way, see if the predefined profiles work for you (no need to duplicate effort). If not, the profiles are easy to customize.