Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

my server is not booting up because there is no /etc/ folder in it. Looks like it has been removed accidently. I have been told by my host to do re installation of OS by booting rescue CD of operating system via KVM console. In the KVM console, I am stuck to a screen whose screenshot I am unable to post because I am not having enough reputation here.

Please tell me how to repair the my Centos 5 64 bit via KVM Console as I do not want to lose /home/ folder because unluckily I am not having recent backups.

share|improve this question
    
Boot the rescue CD, copy your /home directory to some other server, and then reinstall, then copy the files back. –  Michael Hampton Dec 3 '12 at 18:08

2 Answers 2

The /etc folder in basically any Linux / Posix system contains the complete system configuration including basically everything from hardware driver + network config to application software config. Without it and without a backup there is no chance to repair your Linux. Many files here are auto-generated at OS or application software installation time.

To recover the files in /home/ you have the aready mentioned option to boot the server from a live CD (understood that this does not work for you) or the option to remove the server harddrive and connect it to a different server or PC. You could use e.g. a USB to SATA dongle (if its SATA) to be able to hook up the drive to a running PC. To read the Linux file systems, you will need special tools under Windows or another Linux. You could also boot a linux live CD on your own PC, if that works, and then hook up the drive. To read Linux file systems there is different tools freely available on the web, you could e.g. use TotalCommander with the "Ext2+ Reiser" or the "Ext4" add on (see addons). Be careful not to ruin the filesystems or you may loose all the data (there is always data recovery services available out there, but that will cost a bit). good luck!

share|improve this answer
    
I have managed to boot my server through live cd. Now please guide backing up my /home folder through live cd. –  Gursimran Singh Dec 3 '12 at 15:19
    
Is it possible that I upgrade my CentOS 5 to CentOS 6 and the the /home/ remains untouched? –  Gursimran Singh Dec 3 '12 at 15:46
    
If /home is on a separate partition, you can reinstall without formatting this particular partition. –  Christophe Drevet Dec 3 '12 at 16:21
    
If you managed to boot your server on a livecd, you should be able to configure the network to make a copy of /home on a distant machine, through the network. You can use a command like that : tar cj /home | ssh your_remote_server "cd /path/to/backup/dir; cat >home.tar.bz2" to create a tarball of your /home and transfer it on a remote linux machine to /path/to/backup/dir/home.tar.bz2 –  Christophe Drevet Dec 3 '12 at 16:22
    
@ChristopheDrevet I just looked into my disk's scenario via centos installation disc and it is showing Type: Unknown. I guess it is corrupt. Please look at the screenshot and let me know. If it is really corrupted, tell me the ways to recover /home. screenshot: i.imgur.com/8FSep.png –  Gursimran Singh Dec 3 '12 at 17:47

If you have a backup of /etc, even an old one, you can try to restore it with a livecd. If you didn't change anything in the server configuration since the backup, that should help you get back on your feet.

If not, I suggest you to save your important data (/home, I guess) with a livecd. And reinstall.

share|improve this answer
    
No, i do not have any backup of /etc. I 'll have to reinstall it i guess but I do not have any knowledge of working with vm. I have access to my server via KVM console but It is stuck and keyboard is not working. I googled a lot but had no luck to find a guide which can help me to boot my server using live cd and then making a reinstall. I 'll appreciate if you can help me with this. –  Gursimran Singh Dec 3 '12 at 13:01
    
Don't have much experience with KVM. It seems you have to launch your VM with: -cdrom /path/to/your/livecd.iso. Did you try that? –  Christophe Drevet Dec 3 '12 at 13:23
    
How would I put .iso file into my server if it is not working and where 'll I run this command as my server is stuck at this screen. [link)(i.imgur.com/LGLhn.jpg) –  Gursimran Singh Dec 3 '12 at 13:46
    
My bad, I thought you where using linux qemu/kvm virtualization. It's obviously not the case. I don't know how/if you can boot on a CD through your KVM. –  Christophe Drevet Dec 3 '12 at 16:19

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.