Cannot delete folder with rm -rf. Error: device or resource busy

I’m trying to delete /var/named/chroot/var/named/chroot/var/named but I’m getting this error:

rm -rf named
rm: cannot remove `named’: Device or resource busy

pwd
/var/named/chroot/var/named/chroot/var

ERROR : find -name worker
find: File system loop detected; ./var/named/chroot/var/named' is part of the same file system loop as ./var/named’.

what distro are you using ?

I am Using x86_64 x86_64 x86_64 GNU/Linux
distro
with centos 6.2, 40 GB : 1GB RAM

Have you considered deleting it from a LiveCD ? … so it’s not busy.

Are you sure you should be deleting -

/var/named/chroot/var/named/chroot/var/named

and not

/var/named/chroot/var/named

??

See here:

and
https://www.centos.org/modules/newbb/viewtopic.php?topic_id=36112

Well If I try to remove /var/named/chroot/var/named
i get this error

rm -rf /var/named/chroot/var/named
rm: cannot remove /var/named/chroot/var/named/chroot/usr/lib64/bind': Device or resource busy rm: cannot remove /var/named/chroot/var/named/chroot/var/named’: Device or resource busy
rm: cannot remove /var/named/chroot/var/named/chroot/etc/named.root.key': Device or resource busy rm: cannot remove /var/named/chroot/var/named/chroot/etc/named’: Device or resource busy
rm: cannot remove /var/named/chroot/var/named/chroot/etc/named.rfc1912.zones': Device or resource busy rm: cannot remove /var/named/chroot/var/named/chroot/etc/named.iscdlv.key’: Device or resource busy

Mmm, it makes you think something is “chrooted” to /var/named/chroot/var/named … try killing named (or “bind”) first … :slight_smile:

I was just reading that … seems bind is in a “chroot jail”, so stop bind first.

reference:
http://www.virtualmin.com/node/19608
amongst other places.

hi… I stopped named service to check which threads are it using …with etc/init.d/ named stop… but when i restrat it it shows me Error:

/etc/init.d/named start
Cannot find configuration file. You could create it by system-config-bind

I cannot find named.conf in my named directory

whats the problem cannot figure it out

Sorry to just keep posting links, but see if this helps:
https://www.centos.org/modules/newbb/viewtopic.php?topic_id=35560

[EDIT]

Is named.conf in /etc (/etc/named.conf) ?