From owner-freebsd-questions Tue Jun 25 11:31:42 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA26653 for questions-outgoing; Tue, 25 Jun 1996 11:31:42 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA26634 for ; Tue, 25 Jun 1996 11:31:34 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA00258; Tue, 25 Jun 1996 11:30:40 -0700 From: Terry Lambert Message-Id: <199606251830.LAA00258@phaeton.artisoft.com> Subject: Re: int link(const int inode, const char *name2) To: jonny@gaia.coppe.ufrj.br (Joao Carlos Mendes Luis) Date: Tue, 25 Jun 1996 11:30:39 -0700 (MST) Cc: terry@lambert.org, garth@dogbert.systems.sa.gov.au, questions@freefall.freebsd.org In-Reply-To: <199606250318.AAA19340@mailhost.coppe.ufrj.br> from "Joao Carlos Mendes Luis" at Jun 25, 96 00:18:21 am X-Mailer: ELM [version 2.4 PL24] 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 > // Ghah. > // > // You could manually mung the directory. > > This will create a reference, but does not increment the inode refcount. Yes. You will need to fsck it to recover the link count. As long as the blocks are not reused, you are fine. > // 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. The refcount is not relevent for reques if the freemap is not modified. After you have written the data and synced tha machine, you crash it with the power switch and bring it up in single user for the fsck. > // 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. :) Probably better to write a program that includes the real headers and use it to hack the FS. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.