3

I am planning on upgrading my machine to the new Ubuntu 20.04 LTS (possibly Mate) by a clean install. I have a one terabyte external disk that I plan on copying my home directory (152.8 GB) to. This is in case something goes completely haywire, I'd at least have a copy of my old home folder. I have used my current setup (Ubuntu 18.04 LTS) for about four years now and may have tinkered with files in root directory here and there to provide certain files in path and all. To the best of my knowledge, I have all of those files in my home as well.

But just to be safe, are there any other directories in root I should make a copy of? Why?

In addition to this, is there any checklist I should go through before doing a clean install?

Here is how my root looks right now,

user@machine:/$ ls --all
.     cdrom  home            lib32       mnt   run   sys  vmlinuz
..    core   initrd.img      lib64       opt   sbin  tmp  vmlinuz.old
bin   dev    initrd.img.old  lost+found  proc  snap  usr
boot  etc    lib             media       root  srv   var
scribe
  • 680
  • 8
  • 14
  • I tend to backup everything (better safe than sorry, also multiple backups). Where we make changes though is rather individual, I tend to look in /usr/local/bin/ for scripts I have (all users), changes I've made in /usr/share/ (often system wide fonts, themes, which I do to try and keep my $HOME smaller as I don't want my backups to include font etc files, just my created files). I change a few files in /etc/ (esp. fstab, hosts though hosts I usually re-create anyway on new builds). I rarely care about other directories, but that's me & my usage. Your usage may differ, thus backup all. – guiverc May 20 '20 at 00:36
  • "I tend to backup everything", so copy root? – scribe May 20 '20 at 00:37
  • I usually have two partitions, / and /home, if by 'root' you mean / then yes (part of everything). If by 'root' you meant by /root/ then that'll be included in the / backup anyway. I rarely store anything useful in /root/, however should I have done it, i'd always have made a copy on a NFS server anyway (if I didn't, loss won't matter). Yes I copy / as part of 'everything' so I'm covered if I discover later i missed something... In theory I usually consider it can be removed ~two months after the upgrade, in practice it'll still be there when I next upgrade (22.04 on LTS only upgrades) – guiverc May 20 '20 at 00:44
  • I like how you do things! Yes, by root I meant, /. I don't think I have a /root/. I showed the directories I have in /. – scribe May 20 '20 at 00:48
  • Look at your directories; /root/ is there (after proc and before run). It's the user directory for 'root' user (a special case that doesn't get stored in /home/ like other users). If you use whoami and look at who you are, then compare with sudo whoami.. By default 'root' logins are disabled on Ubuntu, but some us do enable them (a lazy fallback) – guiverc May 20 '20 at 01:06
  • It is also good practice to follow the filesystem hierarchy standard so you know where to look for your customizations in the future. – danzel May 20 '20 at 06:04

1 Answers1

2

I would recommend you to copy/backup your /home directory.

List down the names of packages installed on your system

dpkg --get-selections > package_list.txt

You can read about How to list all installed packages.

Note: Before restoring the backup you should always take care of files (~/.bashrc and other files starting with . as prefix. In my opinion I would never copy files starting with . as some of might be system dependent) user directories.

Ashish
  • 201