Author Topic: Cannot delete folder with rm -rf. Error: device or resource busy  (Read 11580 times)

0 Members and 1 Guest are viewing this topic.

Offline AjitSingh15384

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards

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'.

Offline greenian2

  • greenian2@linuxmail.com
  • Full Member
  • ***
  • Posts: 226
  • Karma: 2
  • Gender: Male
  • help people you can and be there if you can
    • View Profile
    • Awards
Re: Cannot delete folder with rm -rf. Error: device or resource busy
« Reply #1 on: October 23, 2012, 05:19:54 pm »
what distro are you using ?
debian linuxmint arch and crux oh hate to say it on a linux web page but freeBsd and OpenIndiana

Offline AjitSingh15384

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Re: Cannot delete folder with rm -rf. Error: device or resource busy
« Reply #2 on: October 23, 2012, 05:48:41 pm »
I am Using   x86_64 x86_64 x86_64 GNU/Linux
 distro
with centos 6.2, 40 GB  : 1GB RAM

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 13492
  • Karma: 332
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Cannot delete folder with rm -rf. Error: device or resource busy
« Reply #3 on: October 23, 2012, 09:04:46 pm »
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:
http://serverfault.com/questions/431303/file-system-loop-detected-in-var-named-chroot-var-named
and
https://www.centos.org/modules/newbb/viewtopic.php?topic_id=36112
« Last Edit: October 23, 2012, 09:06:42 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

Offline AjitSingh15384

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Re: Cannot delete folder with rm -rf. Error: device or resource busy
« Reply #4 on: October 24, 2012, 08:47:42 am »
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

Offline Mad Penguin

  • #Mad_Penguin_UK
  • Administrator
  • Hero Member
  • *****
  • Posts: 1318
  • Karma: 10017
  • Gender: Male
    • View Profile
    • Linux in the UK
    • Awards
Re: Cannot delete folder with rm -rf. Error: device or resource busy
« Reply #5 on: October 24, 2012, 09:25:42 am »
Mmm, it makes you think something is "chrooted" to /var/named/chroot/var/named .. try killing named (or "bind") first ... :)
https://twitter.com/#!/Mad_Penguin_UK

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 13492
  • Karma: 332
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Cannot delete folder with rm -rf. Error: device or resource busy
« Reply #6 on: October 24, 2012, 09:38:19 am »
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.
« Last Edit: October 24, 2012, 11:03:48 am by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

Offline AjitSingh15384

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Re: Cannot delete folder with rm -rf. Error: device or resource busy
« Reply #7 on: October 24, 2012, 11:28:12 am »
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

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 13492
  • Karma: 332
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Cannot delete folder with rm -rf. Error: device or resource busy
« Reply #8 on: October 24, 2012, 11:36:08 am »
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) ?
« Last Edit: October 24, 2012, 11:48:40 am by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal