我的规则
KERNEL=="sd*",ACTION=="add|change",ATTRS{model}=="PERC_H755N_Front",\
ATTR{queue/nomerges}="2",\
ATTR{queue/nr_requests}="1023",\
ATTR{queue/rotational}="0",\
ATTR{queue/rq_affinity}="2",\
ATTR{queue/scheduler}="none",\
ATTR{queue/add_random}="0",ATTR{queue/max_sectors_kb}="4096"
KERNEL=="sd*",ACTION=="add|change",ATTRS{model}=="Dell Ent NVMe v2",\
ATTR{queue/nomerges}="2",\
ATTR{queue/nr_requests}="1023",\
ATTR{queue/rotational}="0",\
ATTR{queue/rq_affinity}="2",\
ATTR{queue/scheduler}="none",\
ATTR{queue/add_random}="0",ATTR{queue/max_sectors_kb}="4096"
SUBSYSTEM=="block",ACTION=="add|change",KERNEL=="nvme*[0-9]n*[0-9]",ATTRS{model}=="Dell Ent NVMe v2 AGN RI U.2 1.92TB",\
ATTR{queue/nomerges}="2",\
ATTR{queue/nr_requests}="1023",\
ATTR{queue/rotational}="0",\
ATTR{queue/rq_affinity}="2",\
ATTR{queue/scheduler}="none",\
ATTR{queue/add_random}="0",\
ATTR{queue/max_sectors_kb}="4096"
SUBSYSTEM=="block",ACTION=="add|change",KERNEL=="md*",\
ATTR{md/sync_speed_max}="2000000",\
ATTR{md/group_thread_cnt}="64",\
ATTR{md/stripe_cache_size}="8192",\
ATTR{queue/nomerges}="2",\
ATTR{queue/nr_requests}="1023",\
ATTR{queue/rotational}="0",\
ATTR{queue/rq_affinity}="2",\
ATTR{queue/scheduler}="none",\
ATTR{queue/add_random}="0", ATTR{queue/max_sectors_kb}="4096"
问题描述
在本例中,我对顶部的 PERC 特别感兴趣。如果我运行udevadm control --reload-rules && udevadm trigger
一切都很好。然而在重新启动时,全部规则适用除了nr_requests
我似乎不明白为什么。下面是我的测试的完整序列,您可以看到,一旦我手动触发规则,一切都会正确应用。但是,重新启动后,nr_requests
仍然错误地设置为 5089。我想不出有什么可以使该属性nr_requests
以其他所有内容都会设置但它不会设置的方式变得特殊。
测试
[root@r7525 ~]# reboot
Using username "root".
[email protected]'s password:
Activate the web console with: systemctl enable --now cockpit.socket
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Fri Sep 16 13:06:28 2022 from 10.8.0.6
[root@r7525 ~]# cat /sys/block/sda/queue/nr_requests
5089
[root@r7525 ~]# cat /sys/block/sda/queue/nomerges
2
[root@r7525 ~]# cat /sys/block/sda/queue/rotational
0
[root@r7525 ~]# cat /sys/block/sda/queue/rq_affinity
2
[root@r7525 ~]# cat /sys/block/sda/queue/scheduler
[none] mq-deadline kyber bfq
[root@r7525 ~]# cat /sys/block/sda/queue/add_random
0
[root@r7525 ~]# udevadm control --reload-rules && udevadm trigger
[root@r7525 ~]# cat /sys/block/sda/queue/nr_requests
1023
[root@r7525 ~]# mv /etc/udev/rules.d/99-my.rules /root
[root@r7525 ~]# reboot
Using username "root".
[email protected]'s password:
Activate the web console with: systemctl enable --now cockpit.socket
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Fri Sep 16 13:41:47 2022 from 10.8.0.6
[root@r7525 ~]# cat /sys/block/sda/queue/nr_requests
256
[root@r7525 ~]# cat /sys/block/sda/queue/nomerges
2
[root@r7525 ~]# cat /sys/block/sda/queue/rq_affinity
1
[root@r7525 ~]# cat /sys/block/sda/queue/scheduler
[mq-deadline] kyber bfq none
[root@r7525 ~]# cat /sys/block/sda/queue/add_random
0
[root@r7525 ~]# mv /root/99-my.rules /etc/udev/rules.d/
[root@r7525 ~]# udevadm control --reload-rules && udevadm trigger
[root@r7525 ~]# cat /sys/block/sda/queue/nr_requests
1023
[root@r7525 ~]# cat /sys/block/sda/queue/nomerges
2
[root@r7525 ~]# cat /sys/block/sda/queue/rq_affinity
2
[root@r7525 ~]# cat /sys/block/sda/queue/scheduler
[none] mq-deadline kyber bfq
[root@r7525 ~]# cat /sys/block/sda/queue/add_random
0
[root@r7525 ~]# reboot
Using username "root".
[email protected]'s password:
Activate the web console with: systemctl enable --now cockpit.socket
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Fri Sep 16 13:47:53 2022 from 10.8.0.6
[root@r7525 ~]# cat /sys/block/sda/queue/nr_requests
5089
[root@r7525 ~]# cat /sys/block/sda/queue/nomerges
2
[root@r7525 ~]# cat /sys/block/sda/queue/rq_affinity
2
[root@r7525 ~]# cat /sys/block/sda/queue/scheduler
[none] mq-deadline kyber bfq
[root@r7525 ~]# cat /sys/block/sda/queue/add_random
0
答案1
它可能被后来(或更早)的规则覆盖。尝试 := 而不是 = 看看是否可以“修复”它。