From owner-freebsd-questions Thu Sep 12 12:35:33 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 DC28037B400 for ; Thu, 12 Sep 2002 12:35:30 -0700 (PDT) Received: from aji.wilshire.net (mail.wilshire.net [64.161.77.243]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3218C43E4A for ; Thu, 12 Sep 2002 12:35:30 -0700 (PDT) (envelope-from rileyjmc@pacbell.net) Received: from emilyd (emilyd.wilshire.net [10.100.123.20]) by aji.wilshire.net (8.12.3/8.12.3) with SMTP id g8CJX4qC096529; Thu, 12 Sep 2002 12:33:04 -0700 (PDT) (envelope-from rileyjmc@pacbell.net) From: "Riley J. McIntire" To: "John Mills" Cc: "Beech Rintoul" , "FreeBSD Questions" Subject: RE: Can't delete a directory Date: Thu, 12 Sep 2002 12:35:25 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 In-Reply-To: Importance: Normal 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 > > > 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