First possibility is that the immutable flag is on. You can change this behavior using the command chattr -i filename
to allow the changes to the file.
But maybe you are running a filesystem with errors; this can make your filesystem become read only entirely or for certain files. Troubles with the RAM can emulate this problem, too. This can be fixed when you reboot the server and runs fsck, but sometimes the server can fail to start and data can be lost when the reboot operation tries to synchronize the information in your RAM to the disk during the restart. If dmesg shows that you are running with memory or filesystem errors, I would recommend a data backup before the reboot, if that is possible. Sometime bad addresses of memory are given by the kernel due to hardware troubles, and some bad data can go to the disks when the system restarts. A crazy kernel is worse than a kernel in panic, and can do some unexpected behaviors like write in your MBR, or important files; it is rare but possible in bad hardware, particularly if you run with bad RAM or with a hot processor. In Brazil, we have a large amount of bad hardware that can cause that. Note: If the trouble is with the RAM memory, don't run FSCK -- it will do crazy things.
UPDATE: Because you're saying you are having troubles only with tmp there is a chance that tmp is being mounted in another partition (with errors perhaps?) or externally (samba, nfs?), so in this case we need more information about your mounted partitions. If that is the case, post the result of your mount
command without any arguments.
chattr +i
situation; confirm withlsattr sort5BtEdh
– Jeff Schaller Jun 09 '17 at 19:27lsattr sort5BtEdh
responds with----------------
as does many of the other files under/tmp
and elsewhere. – ron Jun 09 '17 at 20:46/
and delete it. Umask is 0022. Kernel is3.0.101-71.1.10690.1.PTF-default #1 SMP
– ron Jun 09 '17 at 20:57/dev/sda1 on /boot type ext3 (rw,acl,user_xattr)
– ron Jun 09 '17 at 20:57/dev/sda2 on / type xfs (rw)
and/etc/fstab
hasLABEL=root / xfs defaults 1 1
– ron Jun 09 '17 at 20:57cd /tmp; ls -ld .; df .
– Mark Plotnick Jun 09 '17 at 21:15/tmp
? Otherwise, maybe SELinux active (which would be unusual but not impossible for SLES)? – countermode Jun 12 '17 at 07:57/tmp
related. I also went into Yast AppArmor Configuration and uncheckedEnable Apparmor
then rebooted. Problem persists. – ron Jun 12 '17 at 14:06/tmp
mount options. Could you post it as an answer to help everyone avoid this problem? – dan Mar 26 '18 at 11:23