Why can I not chmod a file

chmodnfspermissions

[nathanb@ka /x/sim/nathanb/nbsim1] ls -al ,nvram
-rw-r--r--    1 root     root      2097152 Jul  5  2011 ,nvram
[nathanb@ka /x/sim/nathanb/nbsim1] sudo chmod a+w ,nvram 
chmod: changing permissions of `,nvram': Operation not permitted

The volume is mounted rw, obviously, since I can modify other stuff. But even if I su as root, I can't chmod this file.

[root@ka /x/sim/nathanb/nbsim1] chmod +w ,nvram
chmod: changing permissions of `,nvram': Operation not permitted

I did an strace on the chmod, and I see this:

stat64(",nvram", {st_mode=S_IFREG|0644, st_size=2097152, ...}) = 0
chmod(",nvram", 0666)                   = -1 EPERM (Operation not permitted)

Here's the output of stat

[root@ka /x/sim/nathanb/nbsim1] stat ,nvram
Name: ,nvram             Size: 2097152       Perms: 0644/-rw-r--r--
Type: Regular File     Blocks: 4120           User: 0/root
Inode: 205777           IOsize: 32768         Group: 0/root

Access Time: Sat Jul 23 09:27:31 2011         Links: 1
Modify Time: Tue Jul  5 18:36:35 2011     FS device: 28
Change Time: Sat Jul 23 09:30:35 2011       Maj/Min: 0/0

And just to prove that there's not weird uid stuff going on:

[root@ka /x/sim/nathanb/nbsim1] id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),503(mailman),21(slocate),30(gopher),500(http),14(uucp),188(xelus),16(radadmin)

Any ideas?

Best Answer

You tagged this under /nfs.. If that file is on an NFS filesystem, you might need to export it on the server with no_root_squash to allow root on the clients to change the permissions on the file system.

Related Question