You are not logged in.
Pages: 1
https://wiki.archlinux.org/title/KVM
4.2 Enabling huge pages
# echo 550 > /proc/sys/vm/nr_hugepages
Produces the error: "warning: An error occurred while redirecting file '/proc/sys/vm/nr_hugepages'
open: Permission denied"
# sysctl -w vm.nr_hugepages=512
from: 14.7. Configuring Huge Pages in Red Hat Enterprise Linux 4 or 5
Appears to work fine for me.
Last edited by JustSomeGeek (2024-12-31 15:05:08)
Offline
This would belong into the wiki discussion page, but "#" indicates a root shell and in case you "sudo echo 550 > …" you're sudo'ing the wrong thing.
Try
echo 550 | sudo tee /proc/sys/vm/nr_hugepages
Offline
See the note in https://wiki.archlinux.org/title/Help:R … other_user
Offline
This would belong into the wiki discussion page, but "#" indicates a root shell and in case you "sudo echo 550 > …" you're sudo'ing the wrong thing.
Tryecho 550 | sudo tee /proc/sys/vm/nr_hugepages
That works. But I was just pointing out that the quoted command on the Wiki page did not give the expected result, so I am attempting to point out an inaccuracy, or ambiguity in the article. (Or my own competence in understanding it.) Also, I thought this was the Wiki discussion sub-forum.
Offline
See the note in https://wiki.archlinux.org/title/Help:R … other_user
Yes, which is why I attempted to sudo the command, as indicated in the article. But thank you.
Offline
This has nothing to do w/ the wiki and there's absolutely nothing inaccurate in it.
The problem is down to
which is why I attempted to sudo the command
Attempting
sudo echo foo > /root/owned/bar
is a classical beginner mistake and reflects unawareness of the shell.
You're elevating "echo" but echo writes to *your* stdout. It is then the redirection (">") which tries to write into the protected path, but the redirection isn't elevated.
You could also use a subshell (I remember a semi-heated debate about which one was more efficient) but piping into the elevated "sudo tee" is probably the most common approach.
In this specific case you can just as much use sysctl which will write into that path and is directly elevatable w/ sudo, but that's a special case and you're better off having understood the problems and some shell basics
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
This has nothing to do w/ the wiki and there's absolutely nothing inaccurate in it.
The problem is down to
which is why I attempted to sudo the command
Attempting
sudo echo foo > /root/owned/bar
is a classical beginner mistake and reflects unawareness of the shell.
You're elevating "echo" but echo writes to *your* stdout. It is then the redirection (">") which tries to write into the protected path, but the redirection isn't elevated.
You could also use a subshell (I remember a semi-heated debate about which one was more efficient) but piping into the elevated "sudo tee" is probably the most common approach.In this specific case you can just as much use sysctl which will write into that path and is directly elevatable w/ sudo, but that's a special case and you're better off having understood the problems and some shell basics
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Ah! Then, my apologies, and thanks, to the Wiki team. The trouble with learning, is not realising you don't know something, until someone else points it out. I'll scuttle away and attempt to educate myself better. Thanks! :-)
Offline
Pages: 1