2

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.

1
  • Have you changed anything outside of your home directory (e.g. the system files stored in /etc)? Aug 18, 2009 at 21:24

5 Answers 5

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.

1
  • Putting /etc under git is neat! :-) Aug 18, 2009 at 22:03
1

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.

1
  • I've always used to do the copying. Using cp gets weird when you're copying links.
    – wds
    Aug 19, 2009 at 9:24
0

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.

0

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

0

I know this is not directly related to this question. However when I run into having to reinstall, I typically just follow this process:

  1. Boot into live media (assuming you're installing from that)
  2. Mount the partition you had your linux system running from
  3. Start a file browser as root
    for example sudo nautilus
    (or nemo, thunar, mc or look up moving around with the command line)
  4. Create a folder that could be called something like OldSystem
  5. Drag and drop everything into OldSystem
  6. Start installing without formatting the partition
  7. Once I'm booted into the new system I can copy or move what ever I want out of /OldSystem

NOTE: If you have more than one Linux partition, (say you're using one for / and another for /home) then repeat steps 2 through 5 for each partition.

I also have a short guide about backing up and restoring a linux system that could have applicable information here: https://superuser.com/a/1107018
In case you'd want to backup your new setup before risking messing it up with bringing in stuff from /OldSystem

1
  • You don't need to boldcaps "note". The gray box suffices by itself.
    – jiggunjer
    Aug 1, 2016 at 5:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .