[SOLVED] I accidently delete my /var server box on CentOS how can I recover it?
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I hope you have a backup. If not, consider using backuppc.
It will automatically back up your computers daily without
you giving it a thought.
Just the fact you're asking what to do makes me think you
don't have a backup. If that's the case, there are two
paths you could take.
The first is a little risky in that you might not recover
some things like scheduled cronjobs. What you could do is
copy the /var directory from another computer of the same
distribution and version.
The second is more work, but a better method. Back up
everything you want to keep from your current system,
reinstall the os, then copy the files you wanted to keep.
You think I did not know these things: backup or OS reinstall I have to say thank you very much but I think it is clear in my question that my system is a server and has important files like mysql data base in /var or more thing I want to recover them back how can I do this for example in windows there is some utilities that undelete or recover deleted files or even formated partitions it has to be same thing in linux . Linux is a powerful OS it has to have some thing for it .
It was just a common mistake in a wrong place "I mean using "rm -rf" and using absolute path "/var" instead of relational path "var" in a sub directory" so what can I do now?
You think I did not know these things: backup or OS reinstall I have to say thank you very much but I think it is clear in my question that my system is a server and has important files like mysql data base in /var or more thing I want to recover them back
I did that search before but thank you again.
I just wanted some tool names that is easy to work and best in recovery that makes me sure to do that I do not want to lose my data because it is my first time that I want to recover my important data I wanted to use your experiences not teaching me how to use google.
I did that search before but thank you again.
I just wanted some tool names that is easy to work and best in recovery that makes me sure to do that I do not want to lose my data because it is my first time that I want to recover my important data I wanted to use your experiences not teaching me how to use google.
If you want your data back, your best hope is to turn the system OFF, as quickly as possible. From there, you MAY have a chance, but there is NOTHING DEFINITE. RIPLinux and photorec MAY be of help. As you've been told, the only reliable method is to restore from backups. If you don't have one, and you've been using the system after the delete...then you probably don't have a chance at all. Reload the OS, and begin again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.