SOLVED Remove files - "Operation not permitted"

ObiTobi

Patron
Joined
Jul 12, 2013
Messages
316
Hi,

by my own mistake I copied some things wrong. Now I can't delete them anymore although I'm doing it as root. How do I get it deleted after all?

find test
test
test/bin
test/bin/rcp
test/sbin
test/sbin/init
test/lib
test/lib/libcrypt.so.5
test/lib/libthr.so.3
test/lib/libc.so.7

rm -rf test/
rm: test/bin/rcp: Operation not permitted
rm: test/bin: Directory not empty
rm: test/sbin/init: Operation not permitted
rm: test/sbin: Directory not empty
rm: test/lib/libcrypt.so.5: Operation not permitted
rm: test/lib/libthr.so.3: Operation not permitted
rm: test/lib/libc.so.7: Operation not permitted
rm: test/lib: Directory not empty
rm: test/: Directory not empty

-r-xr-xr-x 1 root wheel 1006464 Mar 25 2016 test/sbin/init
chmod 777 test/sbin/init
chmod: test/sbin/init: Operation not permitted
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Urk... It looks like you moved these libraries from /lib, and it's not possible to delete them while the system is running.

Please check if /lib/libcrypto.so.5, /lib/libthr.so.3, and /lib/libc.so.7 exist.
 

ObiTobi

Patron
Joined
Jul 12, 2013
Messages
316
Nope, I moved/ copied files from old "jails" directory
And yes, all libs you have listed are here.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Is test a ZFS dataset? If so, then you could just nuke it with zfs destroy <dataset>.
 

ObiTobi

Patron
Joined
Jul 12, 2013
Messages
316
No, I have copied the files to /tmp directory.

I can understand that open files can not be deleted. But they are not in used, why I can't delete them or change their attributes I absolutely don't understand

Problem solved - "chflags noschg fileName" was the solution
 
Last edited:
Top