How to set NOOP scheduler at system boot

There are many different ways to set NOOP scheduler on the first hard drive at system boot. I have decided to use simple systemd service, but alternatively you can use udev to automatically configure every SSD device (see References section).

Create systemd service file to set NOOP scheduler on first hard drive at system boot.

$ cat << EOF | sudo tee /etc/systemd/system/noop.service
Description=SDA noop scheduler
ExecStart=/bin/bash -c 'echo noop | tee /sys/block/sda/queue/scheduler'
Notice that I have used oneshot process start-up type as I only want to execute an action without keeping active process.

Reload systemd manager configuration.

$ sudo systemctl daemon-reload

Enable service at boot time.

$ sudo systemctl enable noop.service


systemd.service — Service unit configuration []

Noop scheduler []

SSDOptimization [] (udev rules)