root user cannot write on file
Hi,
I was trying to edit the following file as root: /sys/module/pcie_aspm/parameters/policy As in the title I cannot write on this file even though I am logged as root. Permissions on this file are set rwx for owner, group, and others (chmod 777) I tried to overwrite the file by using 'echo "string" >/sys/module/pcie_aspm/parameters/policy' and through vi/vim/nano I also trying to set chattr attribute by typing: chattr -a /sys/module/pcie_aspm/parameters/policy chattr -i /sys/module/pcie_aspm/parameters/policy both returning: "inappropriate ioctl for device" Do you know how I can write the file? Thanks for you time |
First, changing permissions of a file, especially a system file to 777 is a terrible practice and not a solution at all. A quick google revealed this: https://serverfault.com/questions/81...off-at-runtime.
|
Is /sys mounted rw?
Type (as root) mount| grep sysfs to check Should give something like: sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) |
Regardless of how. /sys is mounted, changing perms to 777 on any file is a monumentally stupid idea, especially a system file. That was my point to the OP.
|
Quote:
Quote:
|
The link I posted for OP appears to show how to do. this. Thank you ehartman for the file explanation - I had thought these files were in the situation you described but wasn't sure.
|
All times are GMT -5. The time now is 05:27 AM. |