Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Back when I first made the switch to Linux, I didn't know nearly as much about it as I do now. As a result, there are several fundamental things about how my partitions and operating systems are set up (not using 64bit, only have one root partition, etc). I want to wipe the drive completely and start over.

Now, I don't want to lose my configurations or installed packages. My plan is as follows:

  1. Copy the entire contents of my home directory off to an external drive
  2. Generate a list of all installed packages using this guide.
  3. Copy contents of external drive back into home folder (which will be on it's own partition now to avoid issues like this in the future
  4. Re-download/install packages following the method in the aforementioned guide.

Is this a complete way to back up/restore my configurations or will it miss a few things? The only thing I can see it missing are themes and such (which are in /usr and not /home), but I can live with that.

share|improve this question
    
Have you changed anything outside of your home directory (e.g. the system files stored in /etc)? –  Richard Marquez Aug 18 '09 at 21:24

4 Answers 4

Do not forget to save /etc. You can't copy it over the new installation however, because it might cause problems for your system. Some people even put it even under local version control (e.g. using git or mercurial), which provides even more control.

Even if you don't use version control, just keep a safe copy of your precious configuration, you can always look up the last known good configuration and compare it to the current one, if something doesn't work as expected.

share|improve this answer
    
Putting /etc under git is neat! :-) –  Tomas Sedovic Aug 18 '09 at 22:03

If you want to keep your configurations, it's not enough to just copy the home directory. Any modification that required you to enter the admin password was probably stored in /etc. In my experience, it is unfortunately not enough to backup /etc if you're looking to do a full restore. In fact, you can only safely leave off backing up a few directories (/proc, /lost+found, /tmp, /media, /mnt, /sys etc) in this scenario.

The reason I mention this is because you mention a "complete way to back up" and you cannot have a complete backup without a whole lot of directories.

If you haven't done a large number of tweaks to the system, I'd recommend going with the steps you have, and configure the packages again manually. There'll be a lot less cruft in the system this way. You can always keep a copy of /etc to help you perform the tweaks again, but I'd advice against blindly copying the /etc files over in the new install.

Also, when you copy the files over, use cp -a to preserve file ownership and to disable following of symlinks.

Once you have a new installation, you can use something like debfoster or deborphan to keep down the bloat to a minimum.

share|improve this answer
    
I've always used to do the copying. Using cp gets weird when you're copying links. –  wds Aug 19 '09 at 9:24

Generally when backing up anything I take a "back up everything unless you know you don't need it" approach. After /home the rest of the file system shouldn't be more than 5-8gb on an average desktop system. Unless you're really stuck for space don't take any chances and just copy everything.

If you can't afford the space of copying everything then do copy /etc/, and take a look around /var to see if there's anything important to you in there.

Taking a list of packages is a good idea, will make it much easier to re-install.

share|improve this answer

I think you should backup your home folder, of course, plus those data (like icons and themes) inside /usr. Take a look at /var and /etc as people said before, too...

Sometime ago i accidentally reinstalled my Ubuntu 9.04. I already had a standalone home partition. I thought it was magic when I saw my desktop there, and all the settings... I just needed to reinstall all my packages - since my theme comes from one too, the gnome-colors package.

Oh! Don't forget to look at /opt and see if there is any application installed. Take note of it for reinstallation too.

I think it's all you need. Your config files, extra files, programs. Good luck! =D

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.