Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.