Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i mistakenly deleted AS ROOT the /etc directory. now i can't even log in locally since users/passes are gone. it's my home file server with software raid 5. the raid 5 is what i care about. i don't care if i have to redo the system. is it just a matter of reinstalling the OS? do i need any of the mdmraid configs in order to rebuilt/revive the raid later on? any help is greatly appreciated. thanks
i have not rebooted the system since deletion of the directory if that helps.
the mdadm.conf was pretty much autogenerated (didn't add anything to it). so is my next step as easy as redoing the OS and rescanning for array with mdadm app?
Can you backup the data just in case. Are you locked out given that all passwords are gone, or are you still logged in. If the system is running and you can enter commands:
Print out /proc/mdstat
and run:
The raid should be detected by the kernel, so you may be able to boot up with a rescue disk and be able to assemble the array while running off the rescue disk. Recording the information will help in re-creating an mdadm.conf file later down the road. The install program if you reinstall will probably detect the raid array properly as well.
Restoring /etc/ from a backup would be the best solution.
thanks jschiwal. i access the server through SSH, and once the connection was closed there was nothing i could do, so i'm locked out now, even locally on the comp itself.
with that being done i cant perform any of the commands you suggested nor i don't have the backup of /etc (now i will make sure to backup / at all times, since such a stupid mistake can cause such a headache). as for backup it's almost 2TB so i'd have to get some 1TB drives. will live CD detect and mount raid? so i can backup?
i'm just hoping that the fresh install will detect the array and autoconfig it like it did the first time.
Losing /etc in linux is very much akin to losing the registry in Windows.
Reinstalling is your best choice.
Two days ago, I did something stupid and wound up moving the entire contents of /usr/bin into /usr/local/bin. Took me nearly five minutes to sort out. First I had to cd into the latest backup file which resides on another hard drive in this system. Then I had to cp -a the entire contents of that usr/bin directory back into /usr/bin. Then I had to delete the entire contents of /usr/local/bin. Then I had to cp -a the entire contents of the backup usr/local/bin back into /usr/local/bin.
I wonder how long fixing all of that would have taken me if I hadn't had a backup...
I did the same thing about a month ago (thought I was safely chrooted), a reinstall is probably the easiest thing. I copied a /etc from a similarily configured machine and it worked for the most part. I ended up having to reconfigure and reinstall a few packages that weren't on the other machine, had to fix a few diversions, and adjust the users since they had been created in different order. Definitely not something I'd recommend, at the time it seemed better than doing a reinstall since my /home wasn't on its own partition.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.