Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: Should Linux have native undelete features by default?
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700
Rep:
I was thinking the u option does not apply to current ext2 and ext3 filesystems. Only worked on the orginal ext filesystem and no like rieser or others.
BUGS AND LIMITATIONS
The ‘c’, ’s’, and ‘u’ attributes are not honored by the ext2 and ext3 filesystems as
implemented in the current mainline Linux kernels. These attributes may be implemented
in future versions of the ext2 and ext3 filesystems.
The thing is that i got in to some troubles by deleting something by mistake, and there is no recovery... I think at least if it is not a default option there should be a "failsafe" way to know that your files are still there...
If it's a big concern to you, then you should look into creating an alias to move the files you're "deleting" to the trash can. Easier still is to use the GUI to delete, as that puts deleted files in the trash.
Actually even with all of the above I'm quite positive you can still retrieve the files using photorec and foremost.
I have no need for such a feature. In fact, in rox-filer I set it to delete as soon as I hit delete with no prompts whatsoever, and I have never delete anything I didn't mean to.
and actually what i read was that when i file is deleted the linux system writes in those inodes first... so basically the place where your files were get soon overwritten... then that is not true?
Quote:
and I have never delete anything I didn't mean to.
I guess thats because you use GUI a lot... I just used a "find -exec rm" that found exactly what i wanted.... plus a folder that was not supposed to be deleted... and voila.
and actually what i read was that when i file is deleted the linux system writes in those inodes first... so basically the place where your files were get soon overwritten... then that is not true?
Well, they can get overwritten, but they may not, especially if you act ASAP.
Quote:
I guess thats because you use GUI a lot... I just used a "find -exec rm" that found exactly what i wanted.... plus a folder that was not supposed to be deleted... and voila.
thats why i was actually asking since I saw that you actually have the attribute "u" to allow undelete natively in the fs but as they explained me it is not working at the moment, but soon it will, Im glad about that .
if you really are paranoid about this, you can make a directory somewhere (e.g. /var/global_recycle) then write a script to go in /usr/local/bin that will replace the rm command with one that will move everything to the recycle bin of a user or system wide. Then you could clean it up with an extra flag of 'rm --empty'
EXAMPLE SCRIPT ONLY
DO NOT USE AS IS
Code:
#!/bin/sh
if [ $1 == "--empty" ]; then
rm -rf $HOME/trash/*
else
mv $@ $HOME/trash
fi
of course you would need some kind of database file (e.g. /var/log/recycledb) OR have a loop that runs through each file and places it in the trash with a path relative to the root system so that you know where the files go. Additionally you would want to put checks in there to avoid overwriting file names by incrementing the name AND checking for names that are too long so that the increment doesn't extend the end.
you could even make a global config file to go in /etc/recycle.conf
OR you could just get in the habit of not removing anything and just moving it all to a directory your self and delete it when you get around to it.
Enjoy making your system "Oops I didn't make a back up" proof. Me personally, I feel I deserve it when I do something stupid. Then I learn from it.
I guess this would actually be a nice feature for a system administrator when answering the question "where did my file go?!"...
Enjoy making your system "Oops I didn't make a back up" proof. Me personally, I feel I deserve it when I do something stupid. Then I learn from it.
I guess this would actually be a nice feature for a system administrator when answering the question "where did my file go?!"...
I guess you are right...
The script that you proposed is actually a good practice for me since I am learning bash scripting. I will try to do something similar, just for fun though, since I guess people is right by saying that just being a little bit more careful you can avoid some things.
The problem comes when newbies like me start messing with the system (and writing shell scripts) that end up making some "magic" in the system files and then not being able to recover them.
As far as the recovery programs go, I was brain washed from windows with the idea that those only existed for windows, until now I didnt know there were programs for linux as well. As far as I could tell in linux (and mac) when you delete a file "is gone".
Thanks guys for the replays, one learns something new every day isnt that true?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.