Friday, 1 September 2017

linux - Where to put default setting from "/sys" folder in Fedora 18?


I have an SSD main disk and I want to use noop IO scheduler with it, like this:


echo noop > /sys/block/sda/queue/scheduler

But this setting gets lost after reboot. What is a right place to save this setting in Fedora 18? Or, may be, on linux in general?



Answer



The best way to do this is with a udev rule. Add a file to /etc/udev/rules.d with a rule that looks something like this:


ACTION=="add", SUBSYSTEM=="block", ENV{ID_BUS}=="scsi", ENV{ID_SERIAL}=="xxx", ATTR{queue/scheduler}="noop"

Obviously you should replace xxx with the correct serial number for the disk in question. You can find that, and other attributes you could match on, with:


udevadm info --path=/sys/block/sda --query=property

The advantage of using udev to do this, and matching on attributes like the disk serial number, is that it won't matter if it doesn't always appear at sda.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...