restoring /etc files from tar backup
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.
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 :D
* assign multiple names for the same file. (there is a "link-count" in the inode number)
simple solutions often require the most brilliant minds ;)
|All times are GMT -5. The time now is 09:12 PM.|