LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-11-2012, 05:14 AM   #1
takaruz
LQ Newbie
 
Registered: Dec 2012
Posts: 2

Rep: Reputation: Disabled
Question How to undelete data from command "rm -rf /var"


i was SSH to my server. i used wrong cmd. i want to unlink var directory but i typed rm -rf /home/var (softlink to /var) and then, my /vat was gone

i tying to search some issue to solve that problem. i found "extundelete" but i cant ./configure it show

Code:
Configuring extundelete 0.2.0
configure: error: C++ compiler cannot create executables
See `config.log' for more details.
and i try to yum it get message...
Code:
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/$releasever/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
then, i try to use testdisk it can recovery my delete files back but it not all file !!! how can i get back my /var plz help me i lose a lot of mysql and somethind important in /var
 
Old 12-11-2012, 06:32 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Welcome to LQ, even on such a sad occasion, hope you like it here.


Quote:
Originally Posted by takaruz View Post
i typed rm -rf /home/var (softlink to /var) and then, my /vat was gone
I'm sorry to hear that. Do you make regular backups or do you have any backups?


Quote:
Originally Posted by takaruz View Post
i tying to search some issue to solve that problem. i found "extundelete" but i cant ./configure it show
Code:
See `config.log' for more details.
The hint is in the message: it tells you exactly where to look.


Quote:
Originally Posted by takaruz View Post
and i try to yum it get message...
When you deleted /var all files were unlinked. The best way to fsck up recovery is by issuing commands you have no idea about what they cause, especially when they try to write to /var. If the machine wasn't rebooted after deletion and no processes were stopped then the current processes may keep some files open on their file descriptors. Since /var is gone using 'lsof' may be unusable but you could list file descriptors and files with
Code:
lsof -Pwlnd0-255|awk '/var\// {if ($4 ~ "w" ) print "/proc/"$2"/"$4, $NF}'
or
Code:
find /proc/[0-9]*/fd/* -ls 2>/dev/null|grep var/|awk '{print $11, $13}'|sort -u|while read DESCR ITEM; do
 cat "${DESCR}" >> "/other/partition/${ITEM//*\//}"; done

Quote:
Originally Posted by takaruz View Post
then, i try to use testdisk it can recovery my delete files back but it not all file !!!
The best way to get a chance at file recovery would have been to immediately make a 'dd' copy of the partition that holds /var to a file on a physically different disk. Then use Photorec, not Testdisk, to recover files. There is no guarantee all your files can be recovered, for example Photorec only recognizes certain MySQL file types, and some file types don't include enough header or footer information to be exact about it. Furthermore pitfalls you wouldn't want to know anything about like the effect of write operations, secondary and tertiary block allocation and Journaling make recovery harder.
 
Old 12-19-2012, 04:23 AM   #3
takaruz
LQ Newbie
 
Registered: Dec 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
thx u, unSpawn

i try to get my server back but it gone...

now, i setup a new server and i get some data from google webcache.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "intelligent mail" data in libary for barcode command? larrysherk Linux - Newbie 2 03-11-2013 04:51 AM
Using Foremost and general "undelete" questions - Linux Mint GNOME Last_Dino Linux - Software 2 03-16-2010 12:25 AM
How to get the "data type" of an "unknown variable" in "C Language" ? Affair Programming 8 06-20-2009 12:30 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
c gurus: whats the diff? "var[]" and "*var"? kourama Programming 16 04-03-2007 10:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration