Not everyone has access to a tape drive backup system big enough to make daily copies of all the files on all their servers. Even if they do have access to such a system, making a complete backup of every file can be a waste of tape.
Most system administrators choose to backup only key files and user data. Then when it comes time to restore the operating system, they use the original install media to do the bulk of the work. It's even possible to do software upgrades in this manner.
The theory is that after backing up all the right data, you then re-install using your newest OS install CD set instead of the version you used originally. Then after a quick restore of the key files and user data, you should be up and running. The tricky part then comes in knowing which files are "key" files and which ones you can live without. Some stuff is easier to regenerate on a new system, and things like the tape backup driver that took 10 hours to troubleshoot should never be left behind.
Oh Kernel, My Kernel!
You should always backup the kernel. Most administrators have created a custom kernel to allow for special drivers and specific setups on their systems.
FreeBSD calls it /boot/kernel/kernel (Its good to backup this the entire /boot directory)
NetBSD calls it /netbsd
OpenBSD calls it /bsd
NetBSD calls it /netbsd
OpenBSD calls it /bsd
However, backing up just the kernel won't necessarily get everything. Some systems are using loadable kernel modules. If you have installed a custom module you will need to back that up as well. Normally you will be able to get all the modules from the install CDs.
If you are upgrading to a new version, the kernel file won't really be that much of a benefit. What you really need to backup is the custom kernel configuration file you used to create your kernel. The config file is used to create a new kernel binary. If you are upgrading to a major release, you may need to merge in some changes from the system.
On most BSD systems you can find the kernel config files in /usr/src/sys/arch/$ARCH/conf, where $ARCH is the platform or architecture of the system (for example: i386 or sparc64), for NetBSD and OpenBSD or /usr/src/sys/$ARCH/conf in FreeBSD. You should consult your kernel compiling documentation if you can't remember where you left it.
System Configuration Files - /etc
The /etc directory contains all the important system configuration files. The directory is usually very small and easy to backup. If you don't backup the entire directory, you will at least want to get the following files.
- /etc/rc.conf
- Main system configuration file.
- /etc/master.password
- The Master Password File
- /etc/group
- Contains all your user groups.
- /etc/fstab
- Your filesystem layout table. If you fdisk your drive when you upgrade, you may not want to restore this file, but it will be invaluable during a system recovery procedure.
- /etc/inetd.conf
- The internet daemon configuration file. This file has become less important recently, since most of it's services come disabled by default; however if you are using it, you will want to back it up.
- /etc/XF86Config
- the XFree86 configuration file, could also be located in /etc/X11 or /usr/X11R6/etc/X11.
You will also want to backup your mail config files. Generally this will be /etc/sendmail.cf (or /etc/mail/sendmail.cf), however you may have upgraded to Postfix or Qmail, which usually place their configuration under /usr/local/etc/postfix and /var/qmail/control respectively (if you are not sure, consult the documentation for the mail system you are using).
Local Configuration Files - /usr/local/etc
Much of the 3rd party software you install puts configuration files in a common directory, usually /usr/local/etc. This generally makes things easy to backup. Another directory you will want to pay attention to is the rc.d directory. It contains startup scripts for various software packages you install. Many of these files can be regenerated easily by re-installing the package, but of course you should backup anything you have changed.
Conclusion
As with any backup situation, its always a good idea to test your procedures before needing to use them in real life. This also helps you be sure you have backed them up on an accessable media. There are times when I print out some of the configuration files just to preserve the settings for use later, just in case. And don't forget to keep an install CD set around if you aren't backing up all the system files.
No comments:
Post a Comment