root user cannot write on file

PIPPOBAUDO

New Member
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
 


Vrai

Well-Known Member
Credits
1,782
1.) Who is the actual 'owner' of the file.
2.) Perhaps the file cannot be edited while it is in use?
 

jhasaurav

New Member
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

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
 

PIPPOBAUDO

New Member
Credits
0
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"
 

Vrai

Well-Known Member
Credits
1,782
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.
 

PIPPOBAUDO

New Member
Credits
0
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 )
 

dos2unix

Well-Known Member
Credits
1,479
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
 

PIPPOBAUDO

New Member
Credits
0
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:


Members online


Latest posts

Top