Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Dec 1999 23:18:37 +0100 (CET)
From:      Oliver Fromme <olli@dorifer.heim3.tu-clausthal.de>
To:        cjclark@home.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Recovering "Deleted" File
Message-ID:  <199912302218.XAA23739@dorifer.heim3.tu-clausthal.de>

next in thread | raw e-mail | index | archive | help
Crist J. Clark wrote in list.freebsd-questions:
 > I forgot to mention this in my initial mail, but I think there should
 > be a very "safe" way to do all of this.

Yes, of course there is a safe way.  Use tar, restore, cpio or
whatever to recover the file from your backup.  :-)

 > There really is no reason to
 > save the exact same bits that are there now on the disk. I'd be
 > perfectly happy to just copy the "deleted" file into a fresh new file,
 > then let the old one disappear when I close the program.

Once you rm the last directory entry that references the inode
(i.e. the link counter of the inode is zero), there is no file
anymore.  There's only an orphaned inode.  You can only copy
files, not inodes, so you first have to "fake" a new entry for
that inode to create a file.  As far as I know, fsdb is the
only way to do this (and this is only a "hack", of course, it
is not supposed to be a clean way to recover files).

Regards
   Oliver

-- 
Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany
(Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)

"In jedem Stück Kohle wartet ein Diamant auf seine Geburt"
                                         (Terry Pratchett)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912302218.XAA23739>