You are not logged in.

#1 2013-12-19 18:25:10

Archibald-X
Member
Registered: 2013-12-12
Posts: 8

Udev rules and ssd

On a machine that uses multiple disks, the main one of which is an ssd, I have followed the instructions for creating a udev rule to improve its performance as shown here, https://wiki.archlinux.org/index.php/Solid_State_Drives , in the section entitled "Using udev for one device or HDD/SSD mixed environment". However, after I reboot and check the results, it does not show any change. I switched it in the udev rule from cfq to noop, but cfq still shows after rebooting:

$ cat /sys/block/sda/queue/scheduler

noop deadline [cfq]


So, I was wondering whether there may be another cause for this rule getting blocked? Currently, it is the only one I have made for udev.

Offline

#2 2013-12-19 19:52:27

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Udev rules and ssd

Maybe your SSD drive is not correctly registered as non-rotational device with rotational=="0". You should also check the journal, where a possible error in the udev rule would be logged by udev.

lsblk -o NAME,ROTA

Last edited by teateawhy (2013-12-19 19:52:52)

Offline

#3 2013-12-19 22:16:36

Archibald-X
Member
Registered: 2013-12-12
Posts: 8

Re: Udev rules and ssd

Thank you, teateawhy. Sure enough, running "lsblk -o NAME,ROTA" returned #1 in ROTA column. Even so, "smartctl -a /dev/sda" indicates otherwise, and I know it is an SSD. I haven't a clue as to why it would not have registered correctly. Should I simply do "echo 0 > /sys/block/sda/queue/rotational", reboot and see whether it takes, or is there somehow more to making it so?

Offline

#4 2013-12-20 17:55:28

Archibald-X
Member
Registered: 2013-12-12
Posts: 8

Re: Udev rules and ssd

Out of curiosity, and honestly in my anxiousness to get this moving in the right direction, I did some more research on this subject and found some interesting information here, https://lwn.net/Articles/408428/ . One of the points made in it provide what I believe is an affirmative answer to my last question in regard to making a change to the value in the '/rotational' folder:


  " There are various ways of detecting SSDs in the hardware, but they don't always work, especially with the lower-quality devices. So the block layer exports a flag under

       /sys/block/<device>/queue/rotational

  which can be used to override the system's notion of what kind of storage device it is dealing with."

Consequently, I am going to manually change the value from 1 to 0 in order "to override the system's notion", which appears to have erred in its assessment of my ssd drive, which, moreover, is hardly one I would consider "lower quality"! Even 'smartctl' has enough sense to see that much.  smile

Offline

#5 2013-12-20 19:01:02

Archibald-X
Member
Registered: 2013-12-12
Posts: 8

Re: Udev rules and ssd

All righty then, I have a dilemma. I changed the value of '/sys/block/sda/queue/rotational' from 1 to 0 in an attempt to override the system's notion" of what it has, since this is an ssd drive, not magnetic disks, and I added the udev rule in accordance with the instructions here, https://wiki.archlinux.org/index.php/Solid_State_Drives , as noted above. I even manually issued the command "echo noop > /sys/block/sda/queue/scheduler". However, after rebooting, I again looked at the results from 'lsblk -o NAME,ROTA', and I saw that it still shows "1" for sda. Likewise, I get the following results:

$ cat /sys/block/sda/queue/scheduler

noop deadline [cfq]


Therefore, my udev rule did not seem to make any difference, nor did my manual change to the value of '/rotational'.  So, hmmm(?), now I am as puzzled as ever as to why this is not sinking in. Any ideas would be welcome. I want to change the scheduler to noop for this disk only, and I thought the udev rule would do so. Apparently, something is overriding that decision.

Last edited by Archibald-X (2013-12-20 19:02:43)

Offline

#6 2013-12-20 19:53:45

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Udev rules and ssd

Use the script from the archwiki that identifies drives by device ID.
https://wiki.archlinux.org/index.php/SS … devices.29
I used this script before switching to the udev method.

Last edited by teateawhy (2013-12-20 19:54:33)

Offline

#7 2013-12-21 02:02:06

Archibald-X
Member
Registered: 2013-12-12
Posts: 8

Re: Udev rules and ssd

Yes, indeed, the script surely did work  smile  for indicating here:

$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq


Still, the value shows as "1" here:  '/sys/block/sda/queue/rotational'.  I suppose the first one is indicative of what the system is actually doing, but I do want to run another test to confirm that result since the other one indicates differently. Thanks, again, for the help with this problem, teateawhy.  Take care.

Offline

Board footer

Powered by FluxBB