Recover rm command


 
Thread Tools Search this Thread
Operating Systems Solaris Recover rm command
# 1  
Old 08-08-2014
Linux Recover rm command

Consider a situation where in you have used rm command wrongly in a particular directory say

Code:
rm -r *

and we don't have any backup of those files which ever are deleted.

NOTE: I'm not facing situation like this but wanted to know what all options are available for such a situation.

is there any way to recover those files back?.

I'm looking this in Solaris OS; I would also like to know in any linux flavors if you are aware of it
# 2  
Old 08-08-2014
There are a few specialized tools which moderately successful at recovering specific kinds of data. photorec is pretty good at recovering photos deleted from camera cards, for example.

But recovering deleted files without a backup anywhere means stopping the OS from writing to that disk and hoping that particular "unused space" hasn't already been overwritten by new files. Not even FAT partitions have a real "undelete" anymore, and "undelete" didn't always work!

Once that's done, then you do grueling, sector-by-sector brute-force scanning which might get you nameless/partial/garbled results at best if you know exactly what you're looking for (which is how photorec manages to work at all, it scans for JPEG headers). If you can't tell the needle apart from the haystack, the needle is lost.

So there aren't really "options" in the usual sense of the word -- nothing you can actually trust.

Last edited by Corona688; 08-08-2014 at 01:34 PM..
# 3  
Old 08-08-2014
You ask yourself, "Why the hell don't we have BACKUPS?!?!"
# 4  
Old 08-09-2014
Thanks Corona

@achenle: Haha.. That will be an obvious 1st question for everyone !
# 5  
Old 08-09-2014
If you are using ZFS, a nice way to protect against accidental file deletion without doing backups is to regularily create ZFS snapshots. The time-slider service allows to automatize this task.
# 6  
Old 08-09-2014
For normal folk options are reduced to almost nothing…
As you have noticed corona's use of "stopping the OS".. it means the little chance you have to save anything will depend mostly of your knowledge of the system and how fast you are and the time between the command execution and your reaction, for a shutdown is what is to avoid, its a crash you need - a reboot without sync
Then it knowing what was there and look in the lost+found after doing a fsck of the file system where the directory resided… because you won't see files with 1rst letter missing like in FAT but strange numeric or alphanumeric suites as names and you have to decide what you see is, your chances are from 80% ( less than ten seconds have passed) to 0%
(more than 3minutes)
I happen to have had to do this sort of work 2 decades ago when systems weren't as user friendly as today, thats maybe why I am such a paranoid...
This User Gave Thanks to vbe For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

How to recover a host id?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: How to change a host id in solaris 10 2. Relevant commands, code, scripts, algorithms: 3. The attempts... (1 Reply)
Discussion started by: NwStud52
1 Replies

2. UNIX for Advanced & Expert Users

How to recover .bash_history?

rm -rf .bash_history some one ran rm -rf .bash_history on my Linux server(SUSE),I can see this command being run in current history, but I want the OLD history as well,can I recover the old history back. (9 Replies)
Discussion started by: Ankit Bansal
9 Replies

3. UNIX for Advanced & Expert Users

Recover Deleted Folder using rm command

Hi All, I accidentally deleted a important folder using rm command. Can i recover that folder. I don't have any backup mechanism. Please suggest.... its very urgant..Plz (1 Reply)
Discussion started by: vijay.gandra
1 Replies

4. Solaris

Recover solaris 9

Hi Admins, Server : V890 sparc OS : 9 I want to initiate the OS backup. We use SUN storedge tape drive. What backup mode i should use to take the os backup and what is the exact command for the same. Regards newsol (0 Replies)
Discussion started by: newsol
0 Replies

5. UNIX for Dummies Questions & Answers

using the recover command

Hi Guys, just need a little bit of guidance here... i need to recover data from a backup tape using the recover command. can someone please give some pointers as to where to start? Thank you (2 Replies)
Discussion started by: brian112
2 Replies

6. Ubuntu

how to recover libstdc++.so.6

Hi! I'm using Ubuntu Karmic and I lost libstdc++.so.6. Is there a way to recover it?.. Thanks in advance (0 Replies)
Discussion started by: Sapfeer
0 Replies

7. Solaris

recover after delete using rm -rf

Dears, hi all i write this command rm -rf /export/home/john this there any command make me able to restore this folder again (5 Replies)
Discussion started by: jenovaux
5 Replies

8. Shell Programming and Scripting

Is there a way to recover files deleted using rm command???

Hi All, I just mistakingly deleted some files using rm command.Is there a way to get it back?i work on Solaris 10 Thanks, Kumar (1 Reply)
Discussion started by: kumarsaravana_s
1 Replies

9. Shell Programming and Scripting

how to recover with awk

Hi everybody, I have a line output (after doing a awk) which is like: 10.0.0.1 : 0:4:45:a7:67:5 10.0.0.58 : 0:e:aa:18:f9:42 ... how can i recover all data because i want to use each line separetely if anyone has an idea, thanks in advance (1 Reply)
Discussion started by: mips
1 Replies

10. Cybersecurity

Recover A password

Hello All, I have an application user (INFORMIX). This is a system user. It runs processes That I am unaware of. I need to discover the user's password. I can't change it, because it will affect the processes it's runnig. Is there a utility that will allow me to 'su' to that user from root... (3 Replies)
Discussion started by: SmartJuniorUnix
3 Replies
Login or Register to Ask a Question