Recovering a Debian server after accidental deletion of /var directory
Today I had to recover a Debian server after the /var
partition was accidentally deleted. All the user generated data (primarily website content and databases) was backed up, and I also had access to a backup copy of the installed package list as generated by dpkg --get-selections
. The instructions below don’t go into full detail, but hopefully they will set you on the right track. They should also work for Ubuntu installs.
If this happens to you, don’t panic, and whatever you do, don’t shut down or reboot the server!