I am trying to modify something in /sys
. My command is failing.
e.g. echo 63 > /sys/bus/pci/devices/0000:62:00.0/sriov_numvfs
-> bash: echo: write error: Cannot allocate memory
e.g. echo three > /sys/devices/system/node/node1/hugepages/hugepages-1048576kB/nr_hugepages
-> bash: echo: write error: Invalid argument
How can I debug these failures? Is there a general method to find the logs for whatever is on the other side of these virtual files? Ideally I want to find the process or source code for whatever is generating the error message.
sysfs
are only intended to provide information (i.e: are read only), and many others can only be written to while the system is in a certain state (e.g: not configured).