LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-21-2006, 07:05 PM   #1
mikecoates
LQ Newbie
 
Registered: Mar 2006
Location: Warrnambool, Victoria, Australia
Distribution: Mandrake
Posts: 3

Rep: Reputation: 0
How can I restore a deleted /etc directory from installation disks?


How can I restore a deleted /etc directory from installation disks?

The installation process of some third party software hung up, and deleted my /etc directory in the process!! I'm not familiar enough with systems stuff to know how I can restore /etc without having to reinstall the system completely. Is there a way of getting /etc back or getting it the installation disks?

Mike
 
Old 03-21-2006, 07:16 PM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You need to say which distribution this is - different distributions have different installation schemes.

If /etc was ext2, then you can restore without resorting to reinstalling files.

However, I suspect it is more like ext3 or reiserfs or something which makes data recovery difficult.

You can restore the /etc directory just be making it as root. (# mkdir /etc) However, this directory is empty. Not a lot of use to you.

Lots of processes keep their logfiles and so on in /etc ... it may be possible that many apps will just start writing new files. Others will fail with an error to the effect the file is not absent. Logfiles, in general, can just be created (they are normal text files) and the complainant will happily write to them.

As for restoring missing files from the install disk ... depends on the disk and depends on the file. In general, this cannot be done without reinstalling the entire program.

If you have had the foresight to stick /home (and other user modified directories) in a seperate partition, you can restore everything by reinstalling the distro - but telling the distro to leave /home as it is thank you. Otherwise you are faced with a good old back-up and reinstall.

Have fun.
 
Old 03-23-2006, 04:50 PM   #3
mikecoates
LQ Newbie
 
Registered: Mar 2006
Location: Warrnambool, Victoria, Australia
Distribution: Mandrake
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks Simon

Firstly it is the Mandrake/Mandriva 10.0 distribution. I created /, /boot, /usr and /home partitions and they are all fine. Using linux rescue I mounted each of these and found everything intact EXCEPT /etc was missing. I created a new /etc but of course it is empty. Because of this boot can't find inittab and so gives a message that it can't find any more processes in this run level and then effectively shuts down. As far as I can tell with my limited systems knowledge, what I need to do is to reinstall initab, etc., into this new /etc directory. Do you know if installation disks, such as my Mandrake one, has a plain copy (not rpm) of /etc so that I can just copy files across using cp?

Mike
 
Old 03-24-2006, 02:19 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Right - your safest bet is to reinstall mandrake. When you get to partitioning, you have to tell diskdrake to ignore all the installed partitions but root. This will happily restore anything subtle one may miss by manually restoring all the files you need from the disks and it won't touch any settings or stuff you've changed since.

Note: install disks always contain only archives for everything. You could attempt to find someone with a default installation and get them to copy their /etc and send it to you? Maybe a local LUG - or search the mandrake forum for someone sympathetic to ask privately. (Or you could isnstall mandrake to a spare machine and copy the directory and all it's contents over?)

Lastly - but before you go - edit your profile to show distribution and location please. You do this from the "My LQ" menue on the right of this page - just click "edit profile" and hunt down the options.
 
Old 03-28-2006, 04:31 AM   #5
mikecoates
LQ Newbie
 
Registered: Mar 2006
Location: Warrnambool, Victoria, Australia
Distribution: Mandrake
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks Simon

I was hoping that I could avoid a complete reinstall but I understand the dangers of missing essential bits and pieces. I've done so - a few problems such as not being able to get a graphical install and having to use nodma - but we're back in action.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to restore deleted files? ice99 Linux - Security 13 04-13-2006 03:10 AM
how to restore deleted items in fluxbox piva.francesco Linux - Software 1 08-29-2005 05:46 AM
Installation Disks not recognized as official disks when booting with floppy coal-fire-ice Mandriva 13 12-09-2004 04:29 PM
How to restore a deleted file satimis Linux - Newbie 1 09-12-2003 04:18 AM
how to restore deleted files ? ilyes Linux - General 3 08-01-2003 07:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:39 AM.

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