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."
I can't believe how many Windows users get caught out when they dual boot my machine into Windows (have to have it for the office because others use my workstation) and find I have disabled the Recycle bin. Haha, more fool them.
Disclaimer: take with a pinch of salt. If you have sodium issues, take with a pinch of Lo-Salt instead.
Conversion Rate Optimisation French / English consultant
I don't understand why there are so many people saying this is bad or implying that people who use Linux don't need it because they are so good. I must have missed the evolutionary step that made all Linux users so perfect that they never make mistakes. That is all the Recycle Bin is.
Sure, some people use it as temporary folder, but so what? There will always be people who use things other then the way they are intended. If it works for them, so what? If it is so painful for you to contemplate, don't look at it.
[x] Trashcan support
[X] Easy to use Windowing system - KDE
[X] Standard software install system - LSB, Red Hat, Mandrake, Suse
[X] Easy to use Windows filesharing - KDE, Samba
[ ] Easy support for video files and DVD - No answer
[X] Desktop company support - Red Hat, The Kompany
Why is there no README or any other info on your site about this thing? I want to know how it works and how it is different from alias rm='mv ~/.trash', or the KDE trashcan, before I download it. Man I hate sites like this that expect you do download the package, then untar it, just to read a README file. How hard is it to throw it on your website with a link?
Please ignore the idiots above -- the l1nux-l337 are always a pain in the butt about usability issues. As a response to the ask-slashdot rfe from last week, this works really well.
As a point of note, those of you complaining about the disclaimer in the article should realize that, if the disclaimer hadn't been there, you would be complaining about how "/. isn't an advertising service, you Window$ Idiot!!111!11!!!11!!"
Sheesh.
While a trash can is nice to have, this doesn't fundementally address the issue of retrivability of accidently deleted information. That is, there is still going to be a step where information is going to be classed as unretrivable even when it COULD be retrieved. (i.e. when the trash is emptied)
Clearly users appear to want to be able to correct mistakes that they've made -- perhaps even those that were not immediately apparent as being mistakes at the time -- for as long as possible. A trash is a step in that direction, but simply does not go far enough.
My proposal is this: 1st it should be recognized that when you delete a file, you're really only marking the space where that file was as being available to be overwritten by more data. The original data is there, but what it consisted of, and where it was, are lost.
So, let's keep that information in a log so that we can in a very real sense undelete anything that has not yet been overwritten. This log is not especially large, and with modern drive sizes is not a serious concern.
Then, let's order the overwriting process to favor the maximum preservation of data. So for example this might result in new writes being done to the areas of the oldest deleted files first. Important files might be considered to be worth preserving longer, with importance dervived from various factors such as number of accesses, etc. prior to deletion. There's definately work for some user testing here to determine the optimal method. That's okay.
If fragmentation is a worry, (bear in mind most people have never heard of it) then defragging software could take into consideration the undelete log and continue to preserve as much of the deleted data as possible when it shifts information around on the disk.
In any event, the objective is to forestall the day when you have to tell a user who wants to undelete a file for as long as possible. Not longer, which the trash solution does, but AS LONG AS POSSIBLE.
-- This and all my posts are in the public domain. I am a lawyer. I am not your lawyer, and this is not legal advice.
What we need now is the Gnome (or KDE) panel set LD_PRELOAD so that all application can use libtrash.
-- 1.e4 c6 2.d4 d5 3.Sc3 de4: 4.Se4: Sd7 5.Sg5 Sgf6 6.Ld3 e6 7.S1f3 h6 8.Se6:
So, what happens if you send something like ld.so, or your kernel into the recycling bin? Experimenting by randomly moving stuff you don't understand is never a good idea. Just sending it to some sort of recycling bin just gives folks a false sense of security and could lead them to completely hosing their entire install.
So you must never wear a seat belt either because you've never been in a fatal car accident.
Moron.
-- This and all my posts are in the public domain. I am a lawyer. I am not your lawyer, and this is not legal advice.
Don't delete anything, till it has been backed up. You do back up your data, right?
I've been a rabid Linux user from the early days. Today Linux handles DNS, Email, and Web services on my networks...it does NOT handle file access for JUST THIS REASON (lack of undelete).
.XLS file). Excel says it's corrupt (it's a Word document now).
I'm not worried about *me*. When I delete something I fine with it being completely gone. What about completely clueless network users though? Being the MIS/IT MGR for where I work having access to "salvage" on the Novell Netware file servers is a wonderful tool for users mistakes.
Classic example: last week one user created a Excel spreadsheet to be completed by another user. The second user opened the spreadsheet from Word, modified it, and saved it (as a
Getting the inserted table [spreadsheet] from Word back into Excel was next to impossible. Crappy Microsoft programming as usual -- and clueless users to boot. Easiet solution was to salvage the original spreadsheet and instruct user what NOT to do and re-enter the damn data PROPERLY this time.
Linux would have left me high and dry. Well, not really, but having to go back to tape backups to simply salvage one file is a pain in the butt.
I guess Linux will be nothing more than a niche product/market if "gurus" keep their attitudes posted here. Wake up and pay attention to corporate users and admins wants/needs. Telling me I'm clueless and wrong won't gain more market share (well, for Linux at least) -- I've recently bought another Netware license to cover just this issue for another remote office.
Once upon a time I wanted to delete a couple stray mp3s I had in my home directory, so I issued the following command:
.mp3
rm *.mp3
Or so I thought. I had actually accidently told my linux install to do the following in my ~/
rm *
If you cannot tell, there is a " " between "*" and "." As you can imagine this has a very undesired effect, even though I saw it quickly after hitting enter and mashed the ^C as fast as I could.
Undelete would have been useful then. Yes, its a dumb mistake.. but things happen!
Scott.
Often, when I clean out my papers, binders, and whatnot, I end up throwing out stuff that I do need. Being able to root through the trash and retrieve it five minutes later when I come to my senses is very convenient.
Yeah, yeah. I am not leet.:)
Is this a sigs-optional kind of place? 'Cause I am totally down with that if you know what I mean.
Is it that hard?
And this my friends is the attitude keeping Linux from wider acceptance......
Technically, you can use a pint mug to drink champagne. But most people prefer to use a champagne glass or a flute.
;-)
Personally, I prefer to simply hit "delete" to move files to a preset temporary directory (which can also remember where those files originally were, and restore them with a couple of clicks) than to have to manually drag them to a directory I created.
If this kind of "commodity" seems pointless to you, then you probably program by writing machine code with a text editor.
RMN
~~~
>> tell the world why linux needs an undelete
Because the world does not consist of perfect people. Most people will f*ck up from time to time and hose something that they didn't want. While I won't be installing this on any of my systems I'm sure that some of the more consumer-oriented distros might want to add this type of functionality to their products.
That being said, I could see how something like this could be beneficial to many people, so having it as an option is a Good Thing. No one is forced to use it, but it's there for those who do.
There is no need for a trashcan...quite running as a priveleged user. Pay attention to what you are doing, and if you manage 'rm -rd /*', you have once again proven evolution has skipped you.
"Simon Says, Fuck You" - George Carlin
Actually, I've found it's the other way around. If average users know that every mistake is fatal, they become afraid of making ANY mistakes, and that's when you discover a HD completely filled up with garbage that they didn't dare dispose of.
~REZ~ #43301. Who'd fake being me anyway?
This isn't an issue of "lighting fast". The proposed solution, at least without serious modification, would massively fragment the hard drive. The only reason you don't *care* about fragmentation is because you enjoy the pleasant fruits of the fragmentation-resistant ext2, so you don't realize how bad fragmentation can get. The proposed system would fragment the filesystem so badly that a well-used FAT32 system would look contiguous as hell.
You could make a usable system that's somewhat similar...it could shift files around and use, say, a third of the free space for old files.
May we never see th
"As a user I don't push the drives hard enough to notice a difference. I'm not running a high traffic web server, I'm editing documents."
And that's fine, but don't assume that your particular usage is indicative of the vast majority of the masses. I do happen to use my hard drives, often pushing them to the point where the cpu is sitting at 20% waiting for the drive to feed it some data.
"The drive doesn't give a damn what those bits are, it has no concept of full or empty, it just reads and writes where its told. Your filesystem may have issues when you hit 50-80% capacity, but that doesn't have anything to do with the drive."
Well, if you'd like to get technical (as well as snitty), the drive has no "concept" of anything, as that would pre-suppose cognizance. In any event, if you look through any of a number of benchmarks (I personally like HDTach) which may either use a filesystem or not use one to do their work, you'll see that where you're reading/writing on the drive does have an effect on the performance. The filesystem generally cares only in that the fragmentation level tends to be higher at high disk usage, and it becomes increasingly difficult to defragment a drive as the free space dwindles.
I'm not sure what you'd like to call a "typical desktop system", but I can tell you that if you take two systems with identical specs except that one has a 2GB 5400RPM drive with 10MB free, and use it along side another with a 36GB Cheetah X15 with 35GB free space, you'll see a remarkable improvement in many fields, especially games, photo/video/sound editing software, and anything else that requires writes/reads from the hard disk and/or swap file. If you don't think that the performance difference matters most of the time, then I think you ought to send a resume to Redmond, WA, as I'm sure you're just the kind of person they're looking for there.
-- "Government is the great fiction through which everybody endeavors to live at the expense of everybody else."