Unix undelete?

Mike Goss goss at SNOW-WHITE.MERIT-TECH.COM
Tue Nov 6 14:31:17 AEST 1990


> Date: Mon, 5 Nov 90 11:26 EST
> From: MOHRINGJ%ESVAX%dupont.com at relay.cs.net
> Subject: Re:  Strange pmake behavior

>         In Message-Id: <9011041649.AA25370 at snow-white.merit-tech.com>
> Mike Goss writes;
> Not to worry; you can't delete a file in Unix until it's good and ready
> to let you delete it.  Unlike most operating systems, Unix does not
> actually have a file delete operation.  When you think you are deleting
> a file, you are really only unlinking it.
> 
>         Does this mean there is a way of recovering a file you "rm" only
> to find out it was a really big "OPPS!!" in doing so?
> 
> Jim Mohring

No such luck, unless you have another directory entry somewhere else
that's linked to the same file.  If there's only one directory entry
linked to the file, and the file isn't open anywhere, "rm" removes
the last link, which sets the reference count to 0, causing the
I-node to self destruct.

It would in theory be possible for Unix to implement an undelete by
placing deleted I-nodes on some kind of a holding queue, and then
destroying the I-nodes and reclaiming the space in queue order
only when the space is actually needed for new files. This would
probably hurt performance a little bit and probably make disk
fragmentation a little worse; also, your deleted files wouldn't hang
around long on a system short of disk space (aren't they all?). Even
with those disadvantages, it might still be worth it. I don't know of
any Unix file system implementation that actually does this, however
(note to SGI guys and other Unix developers: hint, hint).

------------------------------
Mike Goss
Merit Technology Inc.
(214)733-7018
goss at snow-white.merit-tech.com

	Disclaimer: This offer void except where prohibited by law.



More information about the Comp.sys.sgi mailing list