Recover /var in deleted root file system

General support questions
Post Reply
nsrathnayake
Posts: 2
Joined: 2020/05/26 11:24:42

Recover /var in deleted root file system

Post by nsrathnayake » 2020/05/26 11:51:58

Dear Experts,

I have installed web server in VMWare EXSi environment. For data backup I have setup a script and rsync the files to another server.

I moved the old file deletion line in the script in to the end of the file copying loop. When executing the script has deleted the files in the /bin, /home, /etc and in most directories in /. The /var directory was in a separate partition and all the websites are working as usual. None of the commands are working but cd command.

I tried exporting PATH variables. But no result. Please kindly help me to recover the data to the backup server. Your kind support is highly appreciated. Thank you.

User avatar
TrevorH
Forum Moderator
Posts: 28833
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Recover /var in deleted root file system

Post by TrevorH » 2020/05/26 13:44:49

Back up your data and reinstall.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

nsrathnayake
Posts: 2
Joined: 2020/05/26 11:24:42

Re: Recover /var in deleted root file system

Post by nsrathnayake » 2020/05/26 14:56:29

The issue is non of the commands are working as I described. At least the ls is not working.

pjsr2
Posts: 476
Joined: 2014/03/27 20:11:07

Re: Recover /var in deleted root file system

Post by pjsr2 » 2020/05/27 09:07:27

and all the websites are working as usual.
Highly unlikely to be true. As soon as your web server attempts to execute a process from anywhere in /bin, /usr/bin as part of serving a page, it will fail to do so. Only processes that are running are still working, because they have the program files open. As soon as a still running program is closed it cannot be restarted.

As Trevor suggested, you will need to reinstall. If you have a backup of /var, you can copy that to your new host.

In case you do not have a backup of /var: I think VMware ESXi provides tools to read files in the image of a virtual guest. That may be rather slow, but work. VMware related forums may give you some tips. Don't forget to clone the VMware image before you start tinkering with the image.

Post Reply

Return to “CentOS 7 - General Support”