LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 09-25-2012, 09:15 AM   #1
mandud
LQ Newbie
 
Registered: Sep 2012
Location: Bekasi, Indonesia
Distribution: Linux Mint
Posts: 8

Rep: Reputation: Disabled
Restore deleted files in var folder


Hello everyone,My name is mandud.
just to the point

At the first i want to fix mysql server that didnt want to start
so i follow this steps http://www.unixmen.com/mysqld-dont-start/

but i forgot to backup all files in var folder
and in that article written rm var folder
so all my files in var folder deleted

i've try to install scalpel but it cant
is there any solutions to restore this folder?

thanks
Regards,
Mandud
 
Old 09-25-2012, 10:42 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
Quote:
Originally Posted by mandud View Post
At the first i want to fix mysql server that didnt want to start
Then you should find out from the log file what it errors out on and fix that.


Quote:
Originally Posted by mandud View Post
so i follow this steps http://www.unixmen.com/mysqld-dont-start/
First of all this tutorial just removes and reinstalls software by reflex (common for users of tEh oTher OS) but more importantly it doesn't address the actual error. Like I wrote elsewhere on LQ some tutorials are not that good (outdated, incomplete, lacking knowledge, inefficient etc, etc) but this one is really bad.


Quote:
Originally Posted by mandud View Post
in that article written rm var folder
so all my files in var folder deleted
No, the article said "rm -rf /var/lib/mysql". Alas it didn't tell you to make backups of your databases first and you didn't question the tutorials commands.


Quote:
Originally Posted by mandud View Post
i've try to install scalpel but it cant
My ESP is at an all time low and so at least for me "it can't" is not a helpful indication of what happened. Next time try to be efficient and verbose listing complete commands and errors.


Quote:
Originally Posted by mandud View Post
is there any solutions to restore this folder?
Depending on how log ago deletion happened and if you used the machine in the meantime (the lethal combo) you should attach large enough external storage or another partition and make a copy of the partition to a file on that disk as backup first (as in 'dd if=/dev/partition_name of=/mount_point/partition/name_of_file.dd'). If you only have space for recovered items or if you never separated /var from / then you just have to live with it. Boot a Live CD that contains Photorec, select the filter for only text and MySQL items and ensure you write recovered items to your attached external storage or a partition that does not hold /var.
 
1 members found this post helpful.
Old 09-25-2012, 10:48 AM   #3
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Ouch, that was a really bad advice you got!
But now that it's done:
1) For any kind of undelete or rescue to succeed immediately unmount /var if it's on a separate partition or shutdown NOW!if it's on same as /.
This is because if /var is mounted & system is up things will be written to that partition and chance to succeed gets lower and lower.
Use a live-cd/dvd if necessary just don't mount the partition where /var is!
This is very very important so I stop here for now.
I'll write more, back soon!

-------
Edit: Ok, unSpawn got in while I was writing, giving most of the solution I was ging to write.

Last edited by pingu; 09-25-2012 at 10:52 AM.
 
1 members found this post helpful.
Old 09-25-2012, 11:03 AM   #4
mandud
LQ Newbie
 
Registered: Sep 2012
Location: Bekasi, Indonesia
Distribution: Linux Mint
Posts: 8

Original Poster
Rep: Reputation: Disabled
thanks for all your help..

i've tried to recover using extundelete, but its only recover a few of them
actually size of deleted files more than 20 GB

is there any other options beside live cd because the machine i used its running on vmware
so i cant use live cd

thanks.
Regards,
Mandud
 
Old 09-25-2012, 11:08 AM   #5
mandud
LQ Newbie
 
Registered: Sep 2012
Location: Bekasi, Indonesia
Distribution: Linux Mint
Posts: 8

Original Poster
Rep: Reputation: Disabled
@unSpawn

this the message when i install scalpel

Code:
[root@linux ~]# yum install scalpel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.biz.net.id
 * extras: mirrors.sin3.sg.voxel.net
 * updates: mirrors.sin3.sg.voxel.net
Setting up Install Process
No package scalpel available.
Nothing to do
[root@linux ~]#
 
Old 09-25-2012, 11:09 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
@pingu: what I often do is use the Advanced reply box and then preview my post. That allows me to check what I post and if something was changed in or added to the thread I'm replying to.


Quote:
Originally Posted by mandud View Post
the machine i used its running on vmware so i cant use live cd
Unless you mean something like ESX or equivalent you can configure a VMware guest to boot the ISO of a Live CD.

Last edited by unSpawn; 09-25-2012 at 11:10 AM.
 
1 members found this post helpful.
Old 09-25-2012, 11:55 AM   #7
mandud
LQ Newbie
 
Registered: Sep 2012
Location: Bekasi, Indonesia
Distribution: Linux Mint
Posts: 8

Original Poster
Rep: Reputation: Disabled
ok thanks unSpawn and pingu
i'll try to recover using live cd

Thanks..
Regards,
Mandud.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please Help me...I accedently deleted /var/cache/coolkey folder from server.... maxymaxymaxymaxymaxy Linux - Server 1 07-06-2011 10:09 PM
[SOLVED] Is there any way 2 restore the deleted files in linux anishkumarv Linux - Newbie 6 03-26-2011 08:20 AM
Restore deleted files Winanjaya Linux - Newbie 5 01-09-2007 01:23 AM
how to restore deleted files? ice99 Linux - Security 13 04-13-2006 03:10 AM
how to restore deleted files ? ilyes Linux - General 3 08-01-2003 07:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:08 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