Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2002 12:35:25 -0700
From:      "Riley J. McIntire" <rileyjmc@pacbell.net>
To:        "John Mills" <john.m.mills@alum.mit.edu>
Cc:        "Beech Rintoul" <akbeech@sinbad.net>, "FreeBSD Questions" <freebsd-questions@FreeBSD.ORG>
Subject:   RE: Can't delete a directory
Message-ID:  <HEEELMCBPANKADCOBOFPIEMNGIAA.rileyjmc@pacbell.net>
In-Reply-To: <Pine.LNX.4.21.0209121444580.4629-100000@otter.mills-atl.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>
> > Seems to me running rm -rf in a script wouldn't do any more than cli.
>
> At that point the script has emptied the directories of files, but not
> directories. The script doesn't remove directories from the bottom
> upwards, so you're probably right that it wouldn't work.
>
> Can you manually go to a leaf directory, empty it, then backup one and
> remove it?

I've renamed it, can mv it to any point on its (local) filesystem, including
above the export point, but can't delete it.  The /usr/ and usr/ are a
little confusing below, note that usr/ == /usr/obj/usr.

root@wimp:obj# pwd
/usr/obj
root@wimp:obj# ls -ilaFo usr/fsck_msdosfs/
total 4
155993 drwxr-xr-x  2 root  wheel  - 512 Sep 12 12:26 ./
133633 drwxr-xr-x  3 root  wheel  - 512 Sep 12 12:26 ../
root@wimp:obj# ls -ilaFo usr/
total 6
133633 drwxr-xr-x  3 root  wheel  - 512 Sep 12 12:26 ./
133632 drwxr-xr-x  3 root  wheel  - 512 Sep 12 12:26 ../
155993 drwxr-xr-x  2 root  wheel  - 512 Sep 12 12:26 fsck_msdosfs/
root@wimp:obj# mv usr/fsck_msdosfs/ /usr
root@wimp:obj# cd /usr
root@wimp:usr# rm -rf fsck_msdosfs/
rm: fsck_msdosfs/: Directory not empty
root@wimp:usr# cd fsck_msdosfs/
/usr/fsck_msdosfs
root@wimp:fsck_msdosfs# ls -ilaFo
total 4
155993 drwxr-xr-x   2 root  wheel  - 512 Sep 12 12:27 ./
     2 drwxr-xr-x  19 root  wheel  - 512 Sep 12 12:27 ../
root@wimp:fsck_msdosfs# cd ..
root@wimp:usr# ls -ilaFo fsck_msdosfs/
total 4
155993 drwxr-xr-x   2 root  wheel  - 512 Sep 12 12:27 ./
     2 drwxr-xr-x  19 root  wheel  - 512 Sep 12 12:27 ../
root@wimp:usr#
root@wimp:usr# mv fsck_msdosfs/ /tmp
mv: fsck_msdosfs/: Directory not empty
mv: /bin/rm: terminated with 1 (non-zero) status: Cross-device link
root@wimp:usr#

This does create a /tmp/fsck_msdosfs, which is empty and easily removed.
However, /usr/fsck_msdosfs remains unremovable.

Thanks,

Riley


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?HEEELMCBPANKADCOBOFPIEMNGIAA.rileyjmc>