root user cannot write on file

PIPPOBAUDO

New Member
Joined
Mar 22, 2020
Messages
4
Reaction score
2
Credits
0
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)

Do you know how I can write the file?

Thanks for you time
 


1.) Who is the actual 'owner' of the file.
2.) Perhaps the file cannot be edited while it is in use?
 
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)

Do you know how I can write the file?

Thanks for you time


there is a chatter commands which prevent root to edit or modify or delete any file from the system.

try removing chatter by shooting the below command

#chatter -a filename
or
#chatter -i filename
 
First off thanks everybody for helping me.

1.) Who is the actual 'owner' of the file.
2.) Perhaps the file cannot be edited while it is in use?

root is the owner of the file, group owner is root too
the disk where the file is located is formatted as xfs and is a lvm logical volume


there is a chatter commands which prevent root to edit or modify or delete any file from the system.

try removing chatter by shooting the below command

#chatter -a filename
or
#chatter -i filename

for the chatter command doesn't work, i mean exactly i typed:

(I underline that I typed chattr and not chatter because the last one returned something like "chatter program not found" )

chattr -a
chattr -i

both returning: "inappropriate ioctl for device"
 
root is the owner of the file, group owner is root too
Have you perchance checked the "permissions" of the file?
I know "root" should have all powerful access but can a file have permissions such that root can read and execute but not write?
Maybe a waste of time - but easy enough to check.
Sometimes (most times) troubleshooting is a process of elimination.
 
Have you perchance checked the "permissions" of the file?
I know "root" should have all powerful access but can a file have permissions such that root can read and execute but not write?
Maybe a waste of time - but easy enough to check.
Sometimes (most times) troubleshooting is a process of elimination.
I did by typing:
ls -latr /sys/module/pcie_aspm/parameters/policy

both user owner and group owner were root, and even by issue chmod 777 [file], I still can't write onto the file

Me too I thought root had all the power, probably it is, but not in this kind of situation we're trying to figure out.

As jhasaurav suggested I had issued the chattr command but it gave me error (inappropriate ioctl for device )
 
Just curious, how are you trying to edit this file?

Sometimes vim, vi, nano or emacs won't work.
but usually this does.

echo "some parameter=some value" >> /sys/module/pcie_aspm/parameters/some_file
 
Just curious, how are you trying to edit this file?

Sometimes vim, vi, nano or emacs won't work.
but usually this does.

echo "some parameter=some value" >> /sys/module/pcie_aspm/parameters/some_file

I did both > and >>

It returns:
echo: writing error: operation not allowed
 
Last edited:
maybe system doesn't support pcie aspm.
try
dmesg | grep -i aspm
 

Members online


Top