“rm -f *” undelete



I really ought to find a way to alias “rm -f *” to “rm -i” IF the time is between 1 AM and 7 AM…. Last night I was working late (2:30AM or so when this happened). I had just made a few “refinements” to some of my audio streaming scripts (kept in a “Foreign News Sources” folder). I was curious to see if I had any scripts that were still using realplayer, so I had done a “grep realplay *” and saw a lot of results… but most were in temporary files (left over from a text editor ending in ~)… so there’s radiopragueenglish and radiopragueenglish~ …………..



Well, I get the bright idea that most of those references look to be in the backup or temp files… let me clean them and I THOUGHT I typed “rm -f *~” enter….. unfortunately, when I followed up with the “grep realplay *” I got the dreaded “file not found” equivalent… “grep: *: No such file or directory” oh no…. on reviewing the history I had apparently not mustered the ~ at the end and so had issued a “rm -f *” command. Thank goodness I at least had the scripts in their own subdirectory….

Anyway, I had synchronized the folder with the laptop just a few days ago, but it was put up for the night and so I started looking at how to undelete in linux. I did find the undelete program which is supposed to work for ext2 (I guess it should for ext3 since the journal is the only real difference…) but I use reiserfs… so there is no undelete utility per se however I found references to something that might work.

“reiserfsck –rebuild-tree -S -l /root/rescue.log /dev/

The partition should be unmounted first. If it’s the home partition you’d have to go to single user mode for this. After the operation some files may be restored in place (where they existed previously in the directory structure), others may show up without their original names in a Lost+Found folder in the root of the partition.

You should be warned that the process will likely take a while depending on the size of the partition and may not recover everything. (Also it may cause file corruption for current good files.) So, the bottom line there is to backup the partition before trying this. Really the moral of the story is backup frequently.

Maybe I should just alias rm -f * after 1 am to something like ‘mv * /home/safetynet/’

Of course I’m typing this after copying files back from the laptop. Nothing big lost really. I think I had edited one link and renamed a couple of files. It really wasn’t worth pursuing the whole –rebuild-tree bit… Given the plugin architecture of the new reiserfs I’m wondering if there aren’t possibilities for deleted file recovery within that framework? It’s certainly no replacement for a good backup of some sort, but it might make for an extra layer of safety net…

Related Posts

Blog Traffic Exchange Related Posts
  • Cross browser javascript vulnerability It sounds like this vulnerability would take a great deal of user interaction, but cio-today is reporting on a browser vulnerability that affects pretty much every javascript enabled browser. According to Symantec .... "This issue is triggered by utilizing JavaScript 'OnKeyDown' events to capture and duplicate keystrokes from users," and......
  • Capturing Realmedia RM Streams to a file on Disk There is a lot of software out there that can capture realmedia online streams for a fee. I've found a way in linux to do the same without buying third party software. The main motivation for this is I discovered SBS (an Australian broadcaster) provides audio news programs (1 hour......
  • How to Remove SafeFighter | Safe Fighter Removal Guide SafeFighter is a rogue antivirus application in the same family as TrustCop (TrustCop Removal Guide), SecureWarrior (SecureWarrior Removal), SecurityFighter (SecurityFighter Removal), SecuritySoldier (SecuritySoldier Removal) and it also has gone under other names. It is a rogue application because it installs through either web popups or trojan horse activity, makes false......
Blog Traffic Exchange Related Websites
  • Amend the Citizens United ruling! < When the Supreme Court ruled in the "Citizens United" case, it declared corporations are citizens and that money is speech. In reality the ruling is anti-democratic. Every human being that works for a corporation, that owns corporate stock, they are free to donate their own money personally, to vote......
  • Free Success Ebook: "How to Attract Success" by F. W. Sears – RARE Classic Ebook Download // < ![CDATA[ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); // ]]> // < ![CDATA[ try { var pageTracker = _gat._getTracker("UA-11989331-1"); pageTracker._trackPageview(); } catch(err) {} // ]]> When we first attempt to train our minds to displace these old negative,......
  • 6 Easy Tips on Raising Your FICO Score In today’s world, it’s easy to define your self worth by your FICO score. Whether you are trying to buy a house, get more credit or just get back on the right track, a low FICO score can really impact your entire life. However, there are some easy steps that......
www.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site