From owner-freebsd-questions Wed Sep 11 18:21:22 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0807837B400 for ; Wed, 11 Sep 2002 18:21:17 -0700 (PDT) Received: from catflap.home.slightlystrange.org (host217-39-147-254.in-addr.btopenworld.com [217.39.147.254]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0990143E42 for ; Wed, 11 Sep 2002 18:21:16 -0700 (PDT) (envelope-from dan@slightlystrange.org) Received: from danielby by catflap.home.slightlystrange.org with local (Exim 3.36 #1) id 17pIfK-000707-00 for freebsd-questions@FreeBSD.org; Thu, 12 Sep 2002 02:21:06 +0100 Date: Thu, 12 Sep 2002 02:21:06 +0100 From: Daniel Bye To: FreeBSD Questions Subject: Re: Can't delete a directory Message-ID: <20020912012106.GA26890@catflap.home.slightlystrange.org> Reply-To: dan@slightlystrange.org Mail-Followup-To: FreeBSD Questions References: <200209111704.38102.akbeech@sinbad.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200209111704.38102.akbeech@sinbad.net> User-Agent: Mutt/1.4i X-Scanner: exiscan *17pIfK-000707-00*DGsv4yBqrco* (SlightlyStrange.org, Using NOD32 http://www.nod32.com) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Sep 11, 2002 at 05:04:38PM -0800, Beech Rintoul wrote: > On Wednesday 11 September 2002 04:52 pm, Riley J. McIntire wrote: > > Prior to a buildworld (adding sasl support to sendmail by installing > > cyrus-sasl2 and modifying /etc/make.conf on 4.6.2-RELEASE) when removing > > the old /usr/obj/usr this happened: > > > > root@wimp:obj# chflags -R noschg * && \rm -r usr/ > > rm: usr/src/fsck_msdosfs: Directory not empty > > rm: usr/src: Directory not empty > > rm: usr/: Directory not empty > > > > root@wimp:obj# ls -ilaFo usr/src/fsck_msdosfs/ > > total 4 > > 155993 drwxr-xr-x 2 root wheel - 512 Sep 11 17:14 ./ > > 133634 drwxr-xr-x 3 root wheel - 512 Sep 11 17:14 ../ > > root@wimp:obj# ls -ilaFo usr/src/ > > total 6 > > 133634 drwxr-xr-x 3 root wheel - 512 Sep 11 17:14 ./ > > 133633 drwxr-xr-x 3 root wheel - 512 Sep 1 13:58 ../ > > 155993 drwxr-xr-x 2 root wheel - 512 Sep 11 17:14 fsck_msdosfs/ > > > > It will move within the fs, but not across: > > > > root@wimp:src# mv fsck_msdosfs/ /usr > > root@wimp:src# ll > > total 4 > > drwxr-xr-x 2 root wheel - 512 Sep 11 17:45 ./ > > drwxr-xr-x 3 root wheel - 512 Sep 1 13:58 ../ > > > > root@wimp:src# mv /usr/fsck_msdosfs/ /tmp > > mv: /usr/fsck_msdosfs/: Directory not empty > > mv: /bin/rm: terminated with 1 (non-zero) status: Cross-device link > > root@wimp:src# > > > > Any ideas? > > > > Thanks, > > > > Riley > > Try doing > > rm -R /usr/obj/usr This is no different than rm -r /usr/obj/usr Do this: rm -rf /usr/obj/usr The -f flag tells rm to "Force" the removal of the file/directory, suppresses warnings about non-existant files, and causes rm not to alter its exit status to reflect an error in cases where a file doesn't exist, or its permissions would ordinarily prevent you from removing it. HTH 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 / \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message