LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-14-2008, 03:44 AM   #1
slackman
Member
 
Registered: Mar 2003
Distribution: Slack 9.0
Posts: 123

Rep: Reputation: 15
deleted /etc directory - mdadm.conf gone - raid5 question


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

Last edited by slackman; 08-14-2008 at 04:06 AM.
 
Old 08-14-2008, 03:51 AM   #2
slackman
Member
 
Registered: Mar 2003
Distribution: Slack 9.0
Posts: 123

Original Poster
Rep: Reputation: 15
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?

Last edited by slackman; 08-14-2008 at 04:06 AM.
 
Old 08-14-2008, 06:42 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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:
Code:
         echo 'DEVICE /dev/hd*[0-9] /dev/sd*[0-9]' > mdadm.conf
         mdadm --detail --scan >> mdadm.conf
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.
 
Old 08-14-2008, 11:46 AM   #4
slackman
Member
 
Registered: Mar 2003
Distribution: Slack 9.0
Posts: 123

Original Poster
Rep: Reputation: 15
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.

thanks again jschiwal.

Last edited by slackman; 08-14-2008 at 11:49 AM.
 
Old 08-14-2008, 12:02 PM   #5
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
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...
 
Old 08-14-2008, 02:09 PM   #6
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/lib directory deleted kalaiap Linux - Newbie 1 08-07-2008 01:07 AM
can this directory be deleted/cleaned... cbjhawks SUSE / openSUSE 1 08-30-2006 04:18 PM
The directory that cannot be deleted mickeyboa Fedora 1 03-04-2006 09:28 AM
Deleted directory error gfem Linux - Newbie 2 08-25-2004 12:06 PM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration