Path: utzoo!attcan!uunet!ogicse!ucsd!ucbvax!SNOW-WHITE.MERIT-TECH.COM!goss From: goss@SNOW-WHITE.MERIT-TECH.COM (Mike Goss) Newsgroups: comp.sys.sgi Subject: Unix undelete? Message-ID: <9011060331.AA28217@snow-white.merit-tech.com> Date: 6 Nov 90 03:31:17 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 40 > Date: Mon, 5 Nov 90 11:26 EST > From: MOHRINGJ%ESVAX%dupont.com@relay.cs.net > Subject: Re: Strange pmake behavior > In Message-Id: <9011041649.AA25370@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@snow-white.merit-tech.com Disclaimer: This offer void except where prohibited by law.