goss@SNOW-WHITE.MERIT-TECH.COM (Mike Goss) (11/06/90)
> 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.
aspgpas@cidsv01.cid.aes.doe.CA (Peter Silva) (11/06/90)
In article <9011060331.AA28217@snow-white.merit-tech.com>, goss@SNOW-WHITE.MERIT-TECH.COM (Mike Goss) writes: |> 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). Norton Utilities for UNIX does exactly what you describe, with exactly the same drwabacks... I think (not sure) it's implemented as another file system type, where unlink acts funny (makes another link to some Q when last real link is deleted.) It's only available on 386's naturally... Peter Silva OS Support psilva@cid.aes.doe.ca Dorval Computing Centre (514) 421-4692 Atmospheric Environment Service
guy@auspex.auspex.com (Guy Harris) (11/07/90)
>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. Sounds sort of like what the "undelete" in the Norton Utilities for UNIX does.... (As I understand it, they add a new file system type that intercepts some calls that destroy data - specifically, those that remove files or truncate them to zero length - and that, instead, shoves the file's contents into another file in a hidden directory, presumably not by copying it but by assigning the blocks and file map to another file.) I don't think it exists yet for IRIX; the first implementation was for System V/386. I think SunOS and some other versions are in the pipeline.