From owner-freebsd-hackers Sun Nov 26 13:31:19 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA02878 for hackers-outgoing; Sun, 26 Nov 1995 13:31:19 -0800 Received: from ibp.ibp.fr (ibp.ibp.fr [132.227.60.30]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA02865 for ; Sun, 26 Nov 1995 13:30:54 -0800 Received: from blaise.ibp.fr (blaise.ibp.fr [132.227.60.1]) by ibp.ibp.fr (8.6.12/jtpda-5.0) with ESMTP id WAA29584 ; Sun, 26 Nov 1995 22:30:45 +0100 Received: from (uucp@localhost) by blaise.ibp.fr (8.6.12/jtpda-5.0) with UUCP id WAA06055 ; Sun, 26 Nov 1995 22:30:44 +0100 Received: (from roberto@localhost) by keltia.freenix.fr (8.7.1/keltia-uucp-2.6) id SAA11698; Sun, 26 Nov 1995 18:30:59 +0100 (MET) From: Ollivier Robert Message-Id: <199511261730.SAA11698@keltia.freenix.fr> Subject: Re: How can I remove hard links between directories? To: bob@luke.pmr.com (Bob Willcox) Date: Sun, 26 Nov 1995 18:30:59 +0100 (MET) Cc: freebsd-hackers@freefall.freebsd.org In-Reply-To: <199511261359.HAA01124@luke.pmr.com> from "Bob Willcox" at Nov 26, 95 07:59:32 am X-Operating-System: FreeBSD 2.2-CURRENT ctm#1378 X-Mailer: ELM [version 2.4 PL24 ME8b] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG Precedence: bulk It seems that Bob Willcox said: > 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? Try to get a binary of fsdb from a -CURRENT system. You'll be able to do anything you want even trashing your disk completely :-) FSDB(8) UNIX System Manager's Manual FSDB(8) NAME fsdb - FFS debugging/editing tool SYNOPSIS fsdb [-d] -f fsname DESCRIPTION fsdb opens fsname (usually a raw disk partition) and runs a command loop allowing manipulation of the file system's inode data. You are prompted to enter a command with fsdb (inum X)> where X is the currently selected i-number. The initial selected inode is the root of the filesystem (i- number 2). The command processor uses the libedit(3) library, so you can use command line editing to reduce typing if desired. When you exit the command loop, the file system superblock is marked dirty and any buffered blocks are written to the file system. The -d option enables additional debugging output (which comes primarily from fsck(8)-derived code). COMMANDS Besides the built-in libedit(3) commands, fsdb supports these commands: [...] uplink Increment the active inode's link count. downlink Decrement the active inode's link count. linkcount number Set the active inode's link count to number. -- Ollivier ROBERT -=- The daemon is FREE! -=- roberto@keltia.frmug.fr.net FreeBSD keltia.freenix.fr 2.2-CURRENT #7: Mon Nov 6 21:08:06 MET 1995