Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2002 02:21:06 +0100
From:      Daniel Bye <dan@slightlystrange.org>
To:        FreeBSD Questions <freebsd-questions@FreeBSD.org>
Subject:   Re: Can't delete a directory
Message-ID:  <20020912012106.GA26890@catflap.home.slightlystrange.org>
In-Reply-To: <200209111704.38102.akbeech@sinbad.net>
References:  <HEEELMCBPANKADCOBOFPGEJHGAAA.rileyjmc@pacbell.net> <200209111704.38102.akbeech@sinbad.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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