From owner-freebsd-questions Mon Jun 24 20:20:43 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA21387 for questions-outgoing; Mon, 24 Jun 1996 20:20:43 -0700 (PDT) Received: from mailhost.coppe.ufrj.br (root@cisigw.coppe.ufrj.br [146.164.2.31]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id UAA21366 for ; Mon, 24 Jun 1996 20:20:37 -0700 (PDT) Received: (from jonny@localhost) by mailhost.coppe.ufrj.br (8.7.5/8.7.3) id AAA19340; Tue, 25 Jun 1996 00:18:21 -0300 (EST) From: Joao Carlos Mendes Luis Message-Id: <199606250318.AAA19340@mailhost.coppe.ufrj.br> Subject: Re: int link(const int inode, const char *name2) To: terry@lambert.org (Terry Lambert) Date: Tue, 25 Jun 1996 00:18:21 -0300 (EST) Cc: garth@dogbert.systems.sa.gov.au, questions@freefall.freebsd.org In-Reply-To: <199606242306.QAA02616@phaeton.artisoft.com> from Terry Lambert at "Jun 24, 96 04:06:23 pm" X-Mailer: ELM [version 2.4ME+ PL14 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk #define quoting(Terry Lambert) // > [This is on a BSDI machine, but BSDI and FreeBSD are at least half-brothers, // > so here goes...] // > // > I've accidentally unlinked a file (or rather, had it unlinked for me by gzip // > -- still my mistake) from the directory it was in. The file is, however, // > still open. If I can get the inode (downloading lsof now), is it possible // > to link it to the directory again? // // Ghah. // // You could manually mung the directory. This will create a reference, but does not increment the inode refcount. // If you were root and manually munged the directory it used to live in // by using a binary editor on the block device (assuming it wasn't truncated Can still be done, if you edit the block device to change the file's inode and increment refcount. // and nothing was created in its slot), then all you'd have to do is adjust // the end pointer: ... // It is easy to damage an FS this way. Sure ! This is not child's play. :) Jonny -- Joao Carlos Mendes Luis jonny@gta.ufrj.br +55 21 290-4698 ( Job ) jonny@cisi.coppe.ufrj.br Network Manager UFRJ/COPPE/CISI Universidade Federal do Rio de Janeiro