SEARCH

How-To Geek

How to Choose What to Back Up on Your Linux Home Server

banner

If you have a home server powered by Linux, you’ll probably be upgrading your OS every so often.  Here are some important files to back up and some alternative utilities that will help you get up and running quickly.

Of course, every home server is going to be a little different, and you should adjust these recommendations accordingly—it’s just a general guide to help you understand where to start.

Image by daryl_mitchell

/home

home File Browser

Let’s start with the obvious.  /home contains a folder for each user on your system.  Your personal home directory is where all of your music, movies, pictures, and documents are (unless you use a separate partition for them), but it also houses configuration files for your other programs.  Hit ctrl+H in nautilus to show hidden files and you’ll see a slew of them!  Back up whatever you need.  It’s not a bad idea to back this directory up even if you have a separate /home partition, as reinstalling may overwrite a small number of these configuration files.  Repeat the process for all users.

Apt Sources

-etc-apt

The list of software sources used by apt is located at “/etc/apt/sources.list” and the signed gpg keys are in the /etc/apt/sources.list.d/ directory.  If you’ve used Linux at all, you’ve likely installed software from other repositories than just the defaults.  After you reinstall, you may just have to change the final distro marker to the newer one (e.g. “lucid” to “maverick”) and copy those lines to your new sources.list, but for many repositories you’ll have to download a new gpg key before you can use them.  At the very least, it will at least serve as a reminder of what you had on your old setup.  Ubuntu-Tweak offers a way to install software and repositories, as well as change loads of settings, and serves as an excellent alternative to this backup.

Samba Configuration

-etc-samba

If you set up Samba (Windows) shares, then you’ll need to copy “/etc/samba/smb.conf”.  Samba’s configurations change very little between versions, so you can just use your old copy after reinstalling it.  If you need to reconfigure it or forget to back it up, gadmin-samba (for Gnome) and KSambaPlugin (for KDE) both provide a GUI editor for smb.conf that makes it easier to edit and redo.

SSH

-etc-ssh

If use SSH to remotely access your computer, you may want to save time by backing up its configuration files, located at “/etc/ssh/ssh_config” and “/etc/ssh/sshd_config”.

fstab

fstab after

The file in question is “/etc/fstab” and its job is to be Linux’s file system table.  Make no mistake, you will NOT be able to use your old installation’s fstab file on your new installation.  This is because UUIDs change anytime you reformat a partition.  However, you can copy the rest of the line in your old fstab file so that you don’t have to spend time looking up all of the options.  This is really useful if you have a lot of partitions, auto-mounted shares, a separate /home partition, etc.  You can also use pySDM (Gnome) or mountmanager (KDE), as both provide a GUI process to edit your fstab file, but be sure to do a manual backup yourself first.  From most accounts around the ‘net, it seems safest to learn about the options in fstab and edit it manually, so keep that in mind.

Backup Programs

Backup Properties

If you have your server set up to do automatic backups with tools like rsync or Simple Backup, then you’ll want to grab their configuration files.  Rsync’s config is location at “/etc/rsyncd.conf” and Simple Backup’s is at “/etc/sbackup.conf”.

Website Files

Many people have Apache, MySQL, and/or PHP installed on their home servers to run personal websites.  While their configuration files can be a little too complicated to back up, you shouldn’t forget to do it for your website itself, located in “/var/www”.

-var-www

You’re probably better off reconfiguring Apache, MySQL, and PHP when you reinstall them, as their versions can change and you may want to use newer passwords.  When you go to do that, you can easily install all three in one-shot in Ubuntu with the following command:

sudo apt-get install lamp-server^

And yes, that caret (^) needs to be there.  Don’t forget to install phpMyAdmin to easily configure your MySQL databases!

sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

You’ll need to hit the spacebar when you select your Apache installation.  You’ve done it properly if see an asterisk (*) come up next to it.  And, as always, make sure you change all of the default passwords for everything.  Happy re-installing!

Yatri Trivedi is a monk-like geek. When he's not overdosing on meditation and geek news of all kinds, he's hacking and tweaking something, often while mumbling in 4 or 5 other languages.

  • Published 11/22/10

Comments (8)

  1. Larry Thiel

    Excellent article! But I would suggest it is also very close to a good backup scheme for desktops as well and would not take much editing to make it cover both. No scheme is perfect for everyone, but I think this is one of the best guides I have seen.

    I might think to add an installed package list, some grub (or other boot loader) files, and any customized configuration files.

    And lastly, I will point out that a few, and only a few, readers might not get the inference in the /home section that if you store data in a separate partition you would back that up as well.

  2. trm96

    What theme are you using in the screen shots?

  3. asdf-chan

    never change a running system!

  4. Marc

    Hi, Great article again! was wondering what distro you used for this and the theme details, as i’ve been looking for a gnome theme with exactly this kind of design and colour scheme!

    Thanks

  5. Jonathan

    I understand upgrading (or just trying different distros) on a personal computer, but why would you be upgrading a server OS often???

  6. Diamond

    Hi, this is a great article!
    Is there any more important file to keep while doing backup?

  7. Russ

    My best guess for the theme is “Blue Joy”:

    http://gnome-look.org/content/show.php/Blue-Joy?content=73387

  8. YatriTrivedi

    My theme is based on the BlueJoy Gnome theme and a modified Radial Emerald theme.

    http://gnome-look.org/content/…..tent=73387
    http://gnome-look.org/content/…..tent=71352

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!