rm – Operation not permitted – FreeBSD

Posted: 23rd April 2014 by Thorben Hemmler in FreeBSD, Serveradministration

Manchmal bekommt man beim Löschen eines Ordners bzw. mehrerer Ordner folgende Fehlermeldung:

rm -rf folder1

rm: folder1/lib/libc.so.7: Operation not permitted
rm: folder1/lib/libcrypt.so.5: Operation not permitted
rm: folder1/lib/libthr.so.3: Operation not permitted
rm: folder1/lib: Directory not empty
rm: folder1/libexec/ld-elf.so.1: Operation not permitted
rm: folder1/libexec: Directory not empty
rm: folder1/usr/bin/chfn: Operation not permitted
rm: folder1/usr/bin/chpass: Operation not permitted
rm: folder1/usr/bin/chsh: Operation not permitted
rm: folder1/usr/bin/crontab: Operation not permitted
rm: folder1/usr/bin/login: Operation not permitted
rm: folder1/usr/bin/opieinfo: Operation not permitted
rm: folder1/usr/bin/opiepasswd: Operation not permitted
rm: folder1/usr/bin/passwd: Operation not permitted
rm: folder1/usr/bin/rlogin: Operation not permitted
rm: folder1/usr/bin/rsh: Operation not permitted
rm: folder1/usr/bin/su: Operation not permitted
rm: folder1/usr/bin/ypchpass: Operation not permitted
rm: folder1/usr/bin/ypchfn: Operation not permitted
rm: folder1/usr/bin/ypchsh: Operation not permitted
rm: folder1/usr/bin/yppasswd: Operation not permitted
rm: folder1/usr/bin: Directory not empty
rm: folder1/usr/lib/librt.so.1: Operation not permitted
rm: folder1/usr/lib: Directory not empty
rm: folder1/usr: Directory not empty

Dann wechselt man einfach in den Ordner:

cd folder1

und gibt foldgenden Befehl ein:

chflags -R noschg *

Danach kann man die Dateien ohne Probleme löschen.