Slashdot Mirror


Undelete In Linux

Manuel Arriaga writes "[To the editors: I am not a professional programmer, nor will I ever be one. My income does not depend on my computing/programming skills, and hopefully it never will. So promoting free software I wrote does not help me in any financial way, no matter how indirect. libtrash is free software (GPL2), and I distribute it for free from my website. I have nothing to gain from the increased exposure, except for knowing that I am helping others. And I know slashdot isn't freshmeat... With that out of the way:] I have seen this topic discussed in the LKML multiple times by now, and many more people asking in the newsgroups why "I can't recover my deleted file on GNU/Linux". Here is my answer to that question. libtrash gives Linux a real "trash can". And it has been doing so (with varying degrees of stability) for more than one year now. If you consider it appropriate, make this information public on slashdot."

9 of 565 comments (clear)

  1. Re:Here's a Handy Hint by Anonymous Coward · · Score: 1, Interesting

    I once accidentally did an rm * .~ hoping to just get rid of some emacs floaters. That really sucked, but it was the *only* time I've ever wished I had a way to get back something I deleted.

  2. Possible solution. by FreeLinux · · Score: 3, Interesting

    I think that you are on to the right solution.

    Perhaps the thing to do would be to use two file tables. The first table would be used normally as it is today. It would represent existing files and provide the correct information regarding space usage etc.

    The second table would only be used by the file system and the recovery utilty. The second file table would maintain the information of the files that had been marked for deletion and the file system would consult this table prior to saves so as not to overwrite the files that were marked for deletion.

    When the disk becomes full, the file system should consult the second file table and overwrite the oldest file that had been marked for deletion.

    Also, the recovery utility could consult the second table, listing the files that were marked for deletion but, still reside on the disk. Files selected for recovery could then be added back to the first, primary file table making them again available for the user.

    I'm not sure how Novell does it but, the above method would yield the same behavior as the Novell system.

  3. Re:I know you're kidding, but.... by ndogg · · Score: 2, Interesting

    This is not meant to be a troll, I am seriously asking a question.

    What's not so easy to use under KDE? Whenever I let people use my machine who've only used Windows, they have no problems doing so, unless I happen to have the BeOS window decorations on, but that's understandable. Now, mind you, the only things in my GUI that I concern myself with configuring are the look-n-feel elements, otherwise, I mostly just leave it to the installed defaults. Beyond that, I only concern myself with configuring things like Apache, sshd, samba, or some other such arcane Unix utility.

    --
    // file: mice.h
    #include "frickin_lasers.h"
  4. I don't think this is the right solution... by Ender+Ryan · · Score: 4, Interesting
    I don't think this is the proper solution. There are a lot of programs that create temp files and unlink them, so something like this is going to really clutter up a filesystem really quick.

    I think underlete should be handled at the application level, ie. in konqueror and nautilus, etc. Maybe alias rm to something else for the command line.

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
  5. Its been done... by mengel · · Score: 2, Interesting
    You guys should really look at the old Purdue file entombing code, which these days lives here.

    It is a really efficient way to do this. It was initially done, I think, in 1984 or 1985...

    I think the code that's there is for BSD 4.3, but if you've already done the library work...

    The overview reads:

    This is the Purdue/ksb entombing system. Files removed by programs
    linked with "libtomb" are cached for a while (long enough to get on a
    backup tape would be best case) in case their untimely loss is noticed.

    The 3 programs are "unrm" (the user agent to get files back), "entomb"
    the system agent to cache a file, and "preend" (the system agent to
    clean the older files from the tombs.

    Included as nifty side products are "rmfile" which helps novice users
    delete files with funny names (like "-") and "untmp" which should be
    used to clean /tmp from a ".logout" type file from casual users.

    Currently Andrew J. Korty is working on a project to port the code to current FreeBSD.
    --
    - "History shows again and again how nature points out the folly of men" -- Blue Oyster Cult, 'Godzilla'
  6. Re:Wake-up call by quakeroatz · · Score: 2, Interesting

    No, just another thing you guys like to take credit for thinking up, even though you didn't. You know, like hockey.

    Ahhh! I see you're just looking for a ol' Canada vs. US flamewar.

    A few notes:
    - I've never heard a Canadian say we invented Hockey, we didn't. But we do whip your ass handily at it! I can also gaurantee that your local NHL hockey team is infested with Canucks.
    - Basketball yes we invented that and reigned during the early years of pro ball (yes, a long, long time ago). But! the Raptors are looking excellent this year, and we aren't missing our 4 top guys this time (cough).

  7. RM protection in 5 characters :\-i by drwho · · Score: 3, Interesting

    :>\-i yes it looks like line noise or an emoticon, but it's really a shell script. This protects against rm *.

    so cd to all of your really important directories (/, /etc, /bin), and type :>\-i

    what it does is create an empty file named -i

    when the shell expands * the first file it lists is -i, which rm interprets as an option for interactive mode, so you have to confirm each deletion.

    I am thoe original author of this shell script, consider it GPLd.

  8. Re:I know you're kidding, but.... by TRACK-YOUR-POSITION · · Score: 3, Interesting
    By listing four things here, you've gone right ahead and said that the software install system is _not_ standard. There is a very different user experience for each distribution's install, enough to make the average user think he is installing a different OS for each one. I know my mom thinks Red Hat is an OS.

    For the purpose of this complaint, your mom is basically right. Microsoft doesn't make a package management system that works on multiple corporations distributions of the OS, so why should Red Hat. Just pretend Red Hat is an OS and your complaint goes away. Just because both kernels are signed "Torvalds" doesn't mean their the same OS. Heck, Red Hat even changes the kernel anyway.

    I can't say Samba is easy to use Windows filesharing. Easy to use Windows filesharing is clicking on a button that says share files and seeing that folder show up in Network Neighborhood. It's not SWAT.

    Maybe your describing Mac OS X Windows file sharing, because it's not that easy on any Microsoft OS. Sure, that's all that you're supposed to have to do. But have the time it doesn't work. "Okay, enter this name and password to get my files." "uh--it's just asking me for a password, no name." That's if you can somehow magically get the computers to see each other.

    You can come back and say "you must have done it wrong, TRACK-YOUR-POSITION", but if there was anything for me to screw up, that just proves it's not as easy as you claim it is.

  9. Re:Here's a Handy Hint by russellh · · Score: 2, Interesting

    That's why you use the old trick of having a file named something like "-normstar" (or anything that begins with '-' and which isn't an rm option). rm chokes on it as it scans argv[] for options, and won't delete your files.

    just don't have a file named -rf

    --
    must... stay... awake...