James G. Sack (jim) wrote:
Ralph Shumaker wrote:
I tried *one* thing you suggested on a test file.  But like an idiot, I
tried another thing you suggested on the real thing (without testing
first), namely rm linkName on a command line.  How do I recover the
target that got dumped along with the link?  (And no, I don't have a
backup.)

Short answer: Sorry. Probably no good way.

There is a very painful kind of undelete in ext2 (ext3, too I presume),
that I have used a long time ago. It's available inside mc (midnight
commander), but ..

 1) it probably is critically dependent on the filesystem storage
allocation unit not having been reused since the deletion. I don't know
how to judge, but I'm sure the chances of the storage space getting
overwritten with something else is a monotonically increasing value.

 2) I don't even remember offhand how to use it, but I kind-of remember
it being a bit complicated/non-intuitive and so, it would probably be
best rehearsed on a test system first.

 3) In the best of cases, you may have to examine *lots* (>= thousands)
of files in the lost&found directory to find your deleted file, and then
you may need to binary edit it and/or paste pieces together. This is not
a cheap operation.

Some customer of a prior employer once asked me why anyone would use an
OS that didn't have an undelete in it's default filesystem. I didn't
have an answer. I guess the best answer might be if you want undelete,
then use the "trash" feature (and don't use the command line). Maybe
other people will contribute other answers.

I have often wondered the same thing. I vaguely recall using undelete in DOS and having to supply the missing first letter of the filename. I don't know how delete works in DOS, but IIRC it deletes the filename in the table of contents (the directory) by just changing the first letter of the filename to some null character or somesuch. As long as nothing uses the seemingly empty spots, all that need be done is to supply the missing letter.

What would be an alternative to "rm linkName" on the command line? If you try to rename it, does it not rename the target of the link? same thing with trying to move the link?

Bottom line: if it's priceless[1], then you may want to spend a lot of
time/money to recover it. If not, well, maybe it's just a lesson
learned.  :-( Most of us have done that (shhhh..). :-[

Priceless? Loss of some of it would bum me out for quite some time to come. I'm still bummed out by loss of data on a HD which got an accidental ground to it's circuit board (unexpected, and my fault, which really frosts my shorts). The data is probably still there. But at the time, the drive was too new to find a sibling cheaply so that I could transplant the circuit board long enough to get the data. But now, it's probably so ancient that I would not be able to even *find* a sibling.


[1] I'm sure if it were priceless, you would have a backup.

Regards,
..jim

Backup is right around the corner. And this false alarm moves me to expedite.



--
Ralph

--------------------
More difficult is to take a hard and skeptical (not cynical) look.
Cynicism is easy. Discount everything.
Scepticism is hard. Look carefully at it all.
--Bob La Quey

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-newbie

Reply via email to