LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-24-2003, 06:37 AM   #1
hdagelic
LQ Newbie
 
Registered: Sep 2003
Location: Zagreb, Croatia
Distribution: rh9, debian
Posts: 28

Rep: Reputation: 15
Unhappy restoring /etc files from tar backup


Hello,

I have a server running debian/gnu linux which i started taking
care of recently. I'm trying to find out how to restore the
contents of /etc from a tar backup after a clean install (in
a case of a disaster). There is no problem with /home and /var,
but I was told that you cannot just overwrite configuration
files because the automaticaly generated part after an
instalation can be different than before. And also I heard
that there are "problems with the filesystem" if I overwrite because linux doesn't always access the files by name, but by some low-level fliesystem thing. So when i overwrite, the file is
no longer the same for that thing.
For example, in /etc/passwd there are some sys users which
don't have to have the same uids as before.

The problem is that I don't know what do I have to do in each
config. file (because they are all different), maybe some (or
most) of them I can just overwrite, or maybe not ?

Thank you for your help.
 
Old 09-24-2003, 07:04 AM   #2
yapp
Member
 
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
Well it depends a little on what you're trying to restore. Just blindly restoring everything isn't a good idea at all. no matter what you're trying to restore you'll give away too much of the control that linux offers.

If you open certain files in your favorite text editor, you might be able to figure out what a file is used for. (and you'll learn a lot too). Use tools like "diff", "sdiff" (console), "vimdiff" (vi, console), or "kompare" (kde) to compare files. They are really helpfull. Maybe you want to combine a few options in different versions of the files.

Good things to look for are your httpd (apache) and X11/XF86Config (X display), and maybe a few other files you've modified yourself. (such as your printers, ftp, inetd, samba, and sshd configuration) Remember that /etc/ only contains global configuration settings.

Your personal configuration (the KDE desktop for example) is stored inside your home-directory. ( for example /home/you/.kde/*) You don't need to worry about that.


about that file internal thing: yes they are right, but it's nice to tell the advantages. (here is the full story) afaik, there are no real disadvantages.
* The file system of Linux uses inodes internally. They are records, each contains information for 1 file (such as size, timestamps, and data-block locations) Every inode is known by it's number.
* A directory is just a file containing a table, with "names <-> inode-numbers".
* If you change the name of a file, you simply change the name in the directory. The inode stays the same.
* If a program opens a file, it's name is forgotten instantly, and the kernel uses the inode-number internally.

This structure allows you to:
* move an entire directory tree just by moving 1 name to another directory. (the inode stays the same)
* rename a file while it's in use. (it's just the name that changes)
* remove files while they are in use. (the kernel removes the inotes+data-blocks when they are not in use anymore) .. no reboot required
* assign multiple names for the same file. (there is a "link-count" in the inode number)

simple solutions often require the most brilliant minds

Last edited by yapp; 09-24-2003 at 07:06 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
taking backup and restoring postfix mail files cbekannan Linux - Software 0 11-04-2005 02:49 AM
taking backup and restoring postfix mail files cbekannan Linux - Software 3 10-28-2005 04:34 AM
backup files, tar, do i need to make a copy dtra Linux - Software 3 05-10-2005 08:52 PM
permissions on tar backup files durden2.0 Linux - Newbie 4 08-03-2004 11:50 PM
backup/verify files with tar hokri Linux - General 0 11-27-2001 06:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:51 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