89

I am trying to help a user solve an issue with a bootable USB drive, but there seems to be a file whose ownership cannot be edited. I thought it would have been possible with:

sudo chown user:user ldlinux.sys

When that is executed, however, terminal gives this error:

Operation not permitted

The extended chat I had with the user can be found here.

David
  • 3,487

1 Answers1

78

The file might have the immutable flag (i) set in its extended attributes:

% stat -c '%04a %U %G' ldlinux.sys
0644 root root
% lsattr ldlinux.sys
----i----------------- ldlinux.sys
% sudo chown dev: ldlinux.sys
chown: changing ownership of 'ldlinux.sys': Operation not permitted

If that's the case, run:

sudo chattr -i ldlinux.sys
% sudo chattr -i ldlinux.sys
% lsattr ldlinux.sys
---------------------- ldlinux.sys
% sudo chown dev: ldlinux.sys
%
kos
  • 41,268