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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
03-21-2006, 07:05 PM
|
#1
|
LQ Newbie
Registered: Mar 2006
Location: Warrnambool, Victoria, Australia
Distribution: Mandrake
Posts: 3
Rep:
|
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
|
|
|
03-21-2006, 07:16 PM
|
#2
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
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.
|
|
|
03-23-2006, 04:50 PM
|
#3
|
LQ Newbie
Registered: Mar 2006
Location: Warrnambool, Victoria, Australia
Distribution: Mandrake
Posts: 3
Original Poster
Rep:
|
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
|
|
|
03-24-2006, 02:19 AM
|
#4
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
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.
|
|
|
03-28-2006, 04:31 AM
|
#5
|
LQ Newbie
Registered: Mar 2006
Location: Warrnambool, Victoria, Australia
Distribution: Mandrake
Posts: 3
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 09:31 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|