From owner-freebsd-hackers Sun Nov 26 18:13:42 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id SAA20710 for hackers-outgoing; Sun, 26 Nov 1995 18:13:42 -0800 Received: from skynet.ctr.columbia.edu (skynet.ctr.columbia.edu [128.59.64.70]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id SAA20702 for ; Sun, 26 Nov 1995 18:13:29 -0800 Received: (from wpaul@localhost) by skynet.ctr.columbia.edu (8.6.11/8.6.9) id VAA23308; Sun, 26 Nov 1995 21:13:26 -0500 From: A boy and his worm gear Message-Id: <199511270213.VAA23308@skynet.ctr.columbia.edu> Subject: Re: How can I remove hard links between directories? To: bob@luke.pmr.com (Bob Willcox) Date: Sun, 26 Nov 1995 21:13:25 -0500 (EST) Cc: hackers@freebsd.org In-Reply-To: <199511261359.HAA01124@luke.pmr.com> from "Bob Willcox" at Nov 26, 95 07:59:32 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1624 Sender: owner-hackers@freebsd.org Precedence: bulk Of all the gin joints in all the world, Bob Willcox had to walk into mine and say: > > Help! An apparently buggy version of afio that I was running has > created some hard links between a couple of directories on my system > (2.1-STABLE) and I need to get rid of them. Unfortunately rmdir > simply complains that the directory is not empty (use counts on > these two directries is 4 rather than 2). Can someone please tell > me a way to fix this? > > Thanks, > -- > Bob Willcox > bob@luke.pmr.com (or obiwan%bob@uunet.uu.net) > Austin, TX I can think of one admittedly ugly way to fix this: use clri to zap the inode associated with this troublesome directory, then run fsck to pick up the pieces afterwards. You should probably use ls -i to find the right inode number, then unmount the filesystem and use clri to blow the offending inode away. Then you can use fsck to fix the resulting mess and remount the filesystem. Make sure you get the right inode number or you'll make a bigger mess then you'll fix. :) -Bill -- ============================================================================= -Bill Paul (212) 854-6020 | System Manager Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City ============================================================================= License error: The license for this .sig file has expired. You must obtain a new license key before any more witty phrases will appear in this space. =============================================================================