Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 May 2003 12:44:01 +0100
From:      Daniel Bye <dan@slightlystrange.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: rm: Operation not permitted
Message-ID:  <20030508114401.GA73030@catflap.home.slightlystrange.org>
In-Reply-To: <200305081325.36007.ajacoutot@lphp.org>
References:  <200305081325.36007.ajacoutot@lphp.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 08, 2003 at 01:25:36PM +0200, Antoine Jacoutot wrote:
> Hi !
> 
> I have a ERASE/empty/ directory in /root, and when I want to erase this 
> folder, I get the following error:
> # rm -Rf ERASE/
> rm: ERASE/empty: Operation not permitted
> rm: ERASE/: Directory not empty
> 
> I chmod everything to 777 but still get the same error (as root !).
> Is there any way I can get read of those folders ?

Try 

 # ls -lo /root/ERASE

You will probably see that the directory empty has the "schg" flag set.
This tells the kernel not to allow any alterations to flagged object.  To
remove it, you will need to remove the flag -

 # chflags -R noschg ERASE

will do the trick.  You can then remove ERASE and its contents.  

man chflags(1) for more details.

Dan

-- 
Daniel Bye

PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc
PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030508114401.GA73030>