LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Moved /etc/ Debian squeeze won't boot up now (https://www.linuxquestions.org/questions/linux-newbie-8/moved-etc-debian-squeeze-wont-boot-up-now-919889/)

Oapples 12-21-2011 03:34 PM

Moved /etc/ Debian squeeze won't boot up now
 
I have a server that I updated to Debian squeeze. I had backed up all my data to an external usb drive.

After updating it I was trying to transfer everything from my backups of /var/ and /etc/ back to Debian.

I was successful in doing that for var.

For etc, I don't know what I did but somehow I deleted the local /etc on my computer.

Then I made a etc directory and moved everything from /media/usbdisk/etc-copy/* to /etc/

This my first mistake using mv. I did that for both var and etc and now I don't have backups anymore.

Anyway after doing this I rebooted my computer. The grep boot menu came up. I started like normal but then it gave me some error.

After that I manually turned the computer off. At the boot menu I pressed e on the recovery version. At the end of the linux kernel I typed init=/bin/bash and rebooted. It then came up on a terminal after a bunch of errors with

I have no name! @(none)
None of my logins or root logins worked.
I used ls and saw all my files and folders there as normal including the etc file and everything in it.

I tried moving everything in /etc/ and /var/ back to my external drive so I had backups but it said that my external drive was read only. I also could not see anything inside my external drive when I did a ls.

Please help me. :cry:

Oapples 12-21-2011 04:06 PM

If I'm somehow able to back up certain files in /var to my external usb drive then I'll happily do a reinstall.

Cedrik 12-21-2011 04:28 PM

Ouch... :(
Bah we learn by doing mistakes :)

Do you have a live cd, or install cd from which you could boot and use a workable linux system ?

Oapples 12-21-2011 04:39 PM

Yes I have a live CD. Do you think I could boot up using the live CD and copy var and etc back to my usb drive?

Cedrik 12-21-2011 04:48 PM

From the live system, you could mount your / partition where you installed Debian Squeeze or /var partition (if you use a separate var partition), then mount usb drive and backup whatever you want from your mounted partition to your usb drive.

After that, I don't know Debian so could not really help to recover /etc dir.

Oapples 12-21-2011 04:53 PM

Cool. Thanks for your help.
Also, once I backup everything to my usb drive and then reinstall the OS.
What would be the correct way to move certain files/folders from my backup /etc and /var back to my OS? Because obviously the way I did it wasn't right.

These files contain info regarding passwords, logins, mail etc.

Thanks once again.

Cedrik 12-21-2011 06:28 PM

I suggest to not restore files from backup'd /var, files in this dir are mainly logs and runtime files that will be created and updated on the fly with your new system

For files in /etc, I suggest to restore only config files, don't mess with passwd and shadow, better to create user with same uid as you old user using system commands like useradd and passwd

edit:
If you had mysql databases in /var/lib/mysql or web sites in /var/www of course you want to restore them ;)

Oapples 12-21-2011 06:48 PM

ok. i will give it a try and let you know how it goes!

Thanks a lot!!!


All times are GMT -5. The time now is 09:50 PM.