Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My one of the OpenVZ container backup failed and it had created it's tmp directory:
# ls -l /backups/vps/2013-Jan-14
drwxr-xr-x 4 root root 4096 Jan 15 03:26 vzdump-openvz-101-2013_01_14-22_50_09.tmp
I want to delete above all files but is not allowing to do so.
Whenever I try to delete those it gives below error:
# rm -rf btn_bg-disabled.gif
rm: cannot remove `btn_bg-disabled.gif': Operation not permitted
I tried to delete using inode values but the error is same.
# find . -inum 25165841 -exec rm -i {} \;
rm: remove write-protected character special file `./btn_perl_bg.gif'? y
rm: cannot remove `./btn_perl_bg.gif': Operation not permitted
It looks like you may have a corrupted filesystem.
I don't think having device files show up like that can be anything else.
Now it is possible to get that error on systems running SELinux - it usually is caused by going to root with "su" instead of "su -" before trying to delete files with security labels than prevent deletion.
Many of these files have SUID or SGID set, plus some of them do not have write permission also.
So if your motive is just to remove these files, then you can try to change their permission mode first and then remove SUID/SGID. And then try to remove files as:-
Just as a note - it isn't necessarily the files that are corrupt.
It is the inode that is corrupt. And that points to a disk error or other much worse filesystem corruption.
Deleting the files could just make things worse as freeing up these inodes would make them available for reuse- which could also get corrupted. There is also the problem of the blocks released - if the problem carries on into the filesystem data, (such as duplicate allocations) doing this could cause the other files (which are not yet corrupt) to become corrupted.
you really need to dismount this filesystem and run fsck to see what it reports as bad.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.