0

I have a desktop system on which I want to switch Linux distributions; and I'm going to be installing the new distribution on the same partitions which now hold the old distribution's files. I want to back up essentially all files I'm modified or created which are meaningful, to use on the new system: Either use them as-is (overwriting/creating files on the new system) or keep as a reference, just in case.

I know roughly what major folders require this backup: The home directories of real-life users, most or all of /etc, even if most of it is the same as the distribution made it to be, /opt, /usr/local/src, a list of installed packages I would generate, and a few other bits here and there.

But - I'm sure I'll miss some of it; and my backup choice may be excessive (I e.g. may not need most of /etc). So, I was wondering:

Notes:

  • This is not a question about how to back up files and folders generally. Please don't explain how to use rsync etc.
  • I don't want the backup to be "restoreable", merely accessible as files or decompressible to files
  • I'll want to "err on the side of caution" when it comes to choosing what to back up, but at the same time not back up directories I know are useless. In other words: Assuming I've employed good practice, and have kept local/personal/transient files where they belong - I don't want to backup places like /usr/share, /usr/lib, /var/apt/cache etc, and also not back up things like $HOME/.cache, $HOME/.cargo etc.
  • Answers could be guidelines, a script, or some other means.
  • My distribution switch will not be an upgrade to a newer version of the same or a compatible distribution.
  • Not everything I back up needs to be a copy of a file. I gave the example of the list of installed packages, which does not exist as-is; and I don't intend to back up the entire state of package management state.

Related question: What directories do I need to back up?

  • 2
    If you want to err on the side of caution, backup of the entire fs, excluding binaries directories, logs, and data. The few extra MB wont make a difference. – Rui F Ribeiro Jun 29 '18 at 13:00
  • @RuiFRibeiro: 1. If I try to backi up /proc and /dev, bad things will happen. 2. I'd like like something more fine-grained (and potentially automated) than your suggestion... – einpoklum - reinstate Monica Jun 29 '18 at 13:49
  • 3
    @einpoklum. You should not backup pseudo-filesystems such as procfs. – fpmurphy Jun 29 '18 at 15:09
  • @fpmurphy1: Of course I shouldn't. I was giving those as an example of why you can't "back up the entire fs" as the comment I was responding to suggested. – einpoklum - reinstate Monica Jun 29 '18 at 17:36
  • 1
    proc and dev are seperate filesystems mounted on the root filesystem. If some one says "backup the entire filesystem", of course you should exclude anything that's mounted in there. And I'd second the approach: Exclude everything where you know it's binaries, logs, or distro data (and of course stuff that's mounted you don't need), backup everything else. In other words, err on the side of caution. Without being very familiar with your distro (which you didn't even mention, unless I overlooked it), I don't think anyone can give you a list of directories... – dirkt Jul 1 '18 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.