Udev rule for changing 'max_sectors_kb' for all 'sd*' devices

tomstephens89

Renowned Member
Mar 10, 2014
177
7
83
Kingsclere, United Kingdom
I am having a problem creating a udev rule that sets max_sectors_kb to 1024 for sd* (sda,sdb,sdc etc...) devices under /sys/block/.

Specifically, a recent kernel change means the max IO is too large for my iSCSI SAN so I am trying to set it to 1024 on startup.

I have tried the following from articles online, but none seem to have an effect.

ACTION==”add|change”, SUBSYSTEM==”block”, RUN+=”/bin/sh -c ‘/bin/echo 1024 > /sys%p/queue/max_sectors_kb’”

or

ACTION=="add", ENV{ID_FS_USAGE}!="filesystem", ENV{ID_PATH}=="-iscsi-", RUN+="/bin/sh -c 'echo 64 > /sys$DEVPATH/queue/max_sectors_kb'"

When I run cat cat /sys/block/sdX/queue/max_sectors_kb the value is still the 32767 default.

What do I need to do?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!