recover after delete using rm -rf


 
Thread Tools Search this Thread
Operating Systems Solaris recover after delete using rm -rf
# 1  
Old 07-08-2009
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
# 2  
Old 07-08-2009
NO.... I afraid its not possible.. unless you have backup somewher...
# 3  
Old 07-08-2009
what is your opunion for this solution
# init 1
Use following grep syntax:
# grep -b 'search-text' /dev/partition > file.txt
OR
# grep -a -B[size before] -A[size after] 'text' /dev/[your_partition] > file.txt
Where,

To recover text file starting with "nixCraft" word on /dev/sda1 you can try following command:
# grep -i -a -B10 -A100 'nixCraft' /dev/sda1 > file.txt
# 4  
Old 07-08-2009
That might restore 1 file at a time, if you know what you're looking for, and how much text there was before and after your search string. It probably won't work for binaries (unless you're lucky), and if any process has written to the blocks previously occupied by that file you'll get a lot of garbage (if anything at all).

In short: you've probably learned 2 very valuable lessons:
  1. Always keep a current working backup
  2. When using rm/fdisk/dd/... as root, think at least twice before you hit enter
# 5  
Old 07-08-2009
very thanks pludi for your reply
really this is the first accedinat happen with me
# 6  
Old 07-08-2009
Should you have used OpenSolaris and enabled its ZFS timeSlider feature, you would have recovered most if not all of that directory.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 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. Solaris

Recover rm command

Consider a situation where in you have used rm command wrongly in a particular directory say 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... (5 Replies)
Discussion started by: Gautham
5 Replies

3. 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

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 Solaris 8

Hi, I need to mount the Solaris 8 OS filesystem in order to replace a lib, concretely /usr/lib/ld.so.1. I'm able to boot in single mode with the installation CD, but I'm afraid to mount the root partition because I don't want to risk break the mirror. I tried to follow Performing System... (2 Replies)
Discussion started by: ricardo.amm
2 Replies

8. 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

9. 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