I can not run following command with sudo
to change a sysfs paramete:
$ sudo echo 300 > /sys/block/md0/md/stripe_cache_size
bash: /sys/block/md0/md/stripe_cache_size: Permission denied
However, it works with out sudo
when I change to the root
user:
$ sudo su
[root] [ /home/arh ]
# echo 300 > /sys/block/md0/md/stripe_cache_size
[root] [ /home/arh ]
# cat /sys/block/md0/md/stripe_cache_size
300
Here is the file permissions:
$ ls -l /sys/block/md0/md/stripe_cache_size
-rw-r--r-- 1 root root 4096 Feb 2 08:50 /sys/block/md0/md/stripe_cache_size
Does it make sense to you ?
Note that I have changes /etc/sudoers file with visudo
to make sudo
commands password-less.