Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just made a big mistake and deleted a directory /home/virtfs/. I did not notice it has links to almost every library in the system. I'm running this server with cPanel installed but of course it does not work anymore.

Is there any way to repair the system (restoring all lost files) without having to reinstall it from the beginning?

This is assuming I can boot in rescue mode of course, but if there is any other way that would be great because I can't boot in rescue mode just yet. I will need to contact my provider and I guess everyone is away on holidays now, so what can I do?

Is it safe to rsync libraries through rescue mode to have the server working fine again? Or is there a better way to do this?

share|improve this question
up vote 0 down vote accepted

How did removing a directory in /home hose the system? I suspect the system is still fine, just your account was blown away. If so, restoring the missing links should fix things nicely.

If you really did large-scale damage, I'd suggest salvaging whatever data is valuable, back up configuration files (and check thrice you've got them all), find out what was installed, and just rebuild the machine. It is almost guaranteed that heroic salvage attempts will lead to instabilities and hard-to-fathom problems later on.

My condolences.

share|improve this answer
Actually the directory under /home/ was virtfs which was created by jailshell, it has hard links to system libraries and by deleting this directory I deleted the actual system library, I tried to (as you call it) salvage the system but yes nothing was working correctly, I backed up my data and reinstalled the system after all. – AL-Kateb Jan 12 '13 at 11:09
No, deleting a hard link doesn't delete the target. In Unixy filesystems, a hard link is just an alternative name for the file. Deleting a link deletes the file only if it was the last one. – vonbrand Jan 14 '13 at 14:36
I guess they were not just links, they were bind mounts – AL-Kateb Jan 14 '13 at 15:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .