PDA

View Full Version : [ubuntu] Unable to edit "nr_requests" via echo


caveman8
January 2nd, 2009, 12:55 PM
I'm trying to change the string within
"/sys/block/sda/queue/nr_requests"
from 128 to 512 in order to improve performance of a recently installed 3ware hardware RAID controller.

Whenever I attempt to do so I get an error message.
Below is the command I used and the result:

joe@hilltop:/$ sudo echo 512 > /sys/block/sda/queue/nr_requests
-bash: /sys/block/sda/queue/nr_requests: Permission denied


I am able to edit the file directly if I open it with an editor. However, those edits do not survive across server reboots.

Since I originally ran in to this I have discovered that Ubuntu doesn't allow echoing values to this file. Instead, one is supposed to edit the sysctl.conf file. This would work, except that I am unable to find the appropriate tokens to add or edit.

Thus my question boils down to: how can I edit the value of
/sys/block/sda/queue/nr_requests
so as to have it retain the new value across reboots?

Thanks for any help on this.

I'm running Ubuntu server 8.04, 64 bit.

Thanks again,

Caveman8

sonidhaval@gmail.com
December 6th, 2009, 04:13 PM
Hey you can add entry in /etc/rc.local for the same.

Like:

/bin/echo 512 > /sys/block/sda/queue/nr_requests

Save and exit that file and run this command to check it out.

# source /etc/rc.local

I hope this will work for you..!!

Have a great time..!

ScottNZ
March 14th, 2010, 02:33 AM
@Caveman8:

For what's it's worth, I'm trying to do exactly the same thing for my 3Ware 9650SE Controller, and I'm getting the same "permission denied" error. I'm on Karmic 2.6.31-20-generic; x86_64. Did you have any luck changing nr_requests?

Cheers,
Scott

ScottNZ
March 14th, 2010, 02:52 AM
@caveman8:

Solved it for me. My problem was the way I was executing the command. I was doing this:

sudo echo "512" > /sys/block/sdc/queue/nr_requests

D'oh! That will never work. Open a root shell first:

sudo sh
echo "512" > /sys/block/sdc/queue/nr_requests

Hope that helps.
Scott