Quick Linux Help:
Important Files

What

You're planning a rebuild of your system, and you want to know which files are important to backup so that you can get your new system up and running as soon as possible?

Additionally, you should capture your system settings so you can put your configuration back to the way you enjoy.

System Settings

  1. Consider copying your existing kernel (out of the root) to a floppy disk. This will let you recover your existing system if the new kernel isn't working.

    # makebootdisk

  2. Dump the current mount entires; make sure you know which devices and being mounted where, and that you record the filesystem type along with the read-write/read-only state.

    # mount

  3. Symbolic links for special devices. If you've defined a mouse, model, x10, prolite, phoneswitch, or home-brewed device name, it might help to capture the symbolic links.

    # ls -l /dev | egrep "^l"

  4. Obtain the CPU information.

    # cat /proc/cpuinfo

  5. Obtain the interrupt information. This may provide clues as to what drivers you need.

    # cat /proc/interrupt

  6. Obtain the io ports. This may help with device configuration later.

    # cat /proc/ioports

  7. Determine how large your system memory is.

    # ls -l /proc/kcore; cat /proc/meminfo

  8. See which modules you use.

    # cat /proc/modules

  9. Capture your routing tables.

    # route -n

  10. Capture your interface configuration.

    # ifconfig -a

Which

When copying files with the cp be sure to use the -a option for archiving. This will preserve the permissions and owners (-p), recurse into subdirectories (-R), and preserve links (-d).

/ Note if there are any mount points you may want to preserve. Note the permissoins and owners.

mnt, mnt2, zip, cdrom

/tmp Sometimes important files get left behind in /tmp. Save anything that looks important.
/ramdisk If you are running a ramdisk device, make sure you know what permissions are set for the mount point. Additionally, there may be useful content still in there.
/lost+found Check the lost and found, make sure that you aren't forgetting anything.
/etc/rc.d While you may not restore this directory directly, it is often useful to have. This contains how your system boots.

rc.local may be of special importance.

/etc This directory contains virtually all of your system settings. You may not be restoring it directly, it will have important settings.

passwd - your accounts
shadow - the password
group - the group ids

alises - your mail aliases
sendmail.cf - your mail configuration
sendmail.cR - who you answer mail for

resolv.conf - DNS
named.conf - DNS Named Save the directory specified by options/directory

sudoers - who can use sudo

syslog.conf - where log info goes You may want to save your logs

fstab - file system table

issue - your system message
issue.net - system message for telnet

/usr/local This will save all your localized changes. Typically including your webserver, games, Java, MySQL, DNS settings, Samba, programs, libraries, Python, info and man pages, Tcl/Tk, etc.
/opt This is another common place where software you installed goes, if you didn't put it under /usr/local
/home Save all of your user's home directories. When restored the UIDs/GIDs must match the /etc/passwd and /etc/group files.
/root Do not forget that root has a different location for his home directory.
/var This is where applications that need to store or persist data put it. Backing up the whole /var branch may record megabytes of log files you might not want to keep.
/var/games Sometimes some game settings will be in here.
/var/spool/mail Your user's mailboxes hide here.
/var/cron You may have cron jobs hiding here
/var/lib/httpd Some versions of Apache used to hide here, but now most are under /usr/local/apache

This page last updated 21-Feb-2000 11:38:34.
Linux Quick Help by MindPrint