0

I previously used windows and had Acronis TrueImage that took System Image backups periodically. I cannot find any decent System Image backup tool but Deja Dup backup seems to be promising. CloneZilla only works with LiveCD or boot-able USB not a solution practical with my use case.

  1. Can I backup the entire OS with Deja Dup and restore it on another new Disk with fresh install of Ubuntu? will all the installed applications and users with permissions work?
  2. Which keys (.ssh, .gnupg, etc) should I take backup of and where do I find these keys in a normally installed and used Ubuntu OS? See: Deja Dup risk of data loss

Ubuntu 20.04 LTS

3 Answers 3

4
  1. No, 1st off: permission are likely skewered: you need to probably make sure user id, and group id are identical. Also: it is not the intended usage for deja-dup. Clonezilla is not a backup tool and as such not a replacement for deja-dup.

  2. All files related to configurations for a $USER are in /home/$USER/. Do a ls -la to show hidden files. ~/config/ holds most of the settings; browsers; favorites/bookmarks, sessions,

  • .ssh: Default is likely /home/$USER/.ssh.

  • .gnugpg: all secret keys are stored in the private-keys-v1.d directory below the GnuPG home directory.


It is also not a good idea to copy all configurations over from another system: you will at some point run into compatibility issues. It is far more stable to re-install your applications and then copy settings over per app.

I myself do this:

  1. All my files are on a partition called /discworld/
  2. I have a script that alters all the settings I want changed after a re-install.
  3. During an install of Ubuntu I format / and /home/ and mount /discworld/. That partition has /discworld/Desktop and all other dirs.
  4. After install I run my script so all (g)settings are set, changed files (like ./config/users-dirs.dirs) are replaced by my version, and software I use gets installed.
3

Not for System-wide Backup

DejaDup is not the tool for system-wide backups. Backing up apps and system folders in Linux is tricky as one needs to preserve the ownership and permissions to make the system files work. If you want to have a backup of the system files and folders, it is best to boot it from a Live USB.

Many experienced Ubuntu users don't bother with system backups and just start with a fresh installation in a new computer. They may also keep a list of apps they have installed, and install them again after installing Ubuntu.

This is because Ubuntu (Linux in general) does not work like Windows. The OS and the installed apps have many files in common. This is called "dependency." If you install a newer version of Ubuntu in the new computer and try to restore an app that was backed up from an older version of Ubuntu in the old computer, the app probably won't work and the common files won't match.

DejaDup Backs Up Users' Data

By default DejaDup backs up an user's home folder and all its sub-folders when the user is logged in. That is. /home/aagam/ (Assuming "aagam" is your username).

If there is a second user of your computer, let's say the user "Begam", then that user's data in /home/begam/ is not backed up until Begam sets up the backup task.

Note, permissions are not defined by the username, but the UID (not to be confused with UUID), which is a number. For example, the user Aagam may have the UID 1000, and Begam may have the UID 1001 in the old computer. If the names and IDs are switched, in the new computer. For example, if Aagam has the UID 1001 and Begam has the UID 1000, then restoring the backup from the old computer to the new computer may give the permissions and ownership to the wrong person.

Configurations, Preferences, and Hidden Files/Folders

Ubuntu keeps the user specific settings, and encryption keys in the user's home folder. For example your ssh and gnupg (gpg) private keys are stored in the respective folders:

/home/aagam/.ssh/
/home/aagam/.gnupg/private-keys-v1.d/ 

Since these are sub-folders of your home folder /home/aagam/ they are all backed up when you set up DejaDup to backup your files.

Note the . in front of the folders .ssh and .gnupg. That means these folders are hidden.

Hope this helps

3

To back up your system (not your user data) you can use Timeshift, which is provided in the Ubuntu repos.

You will need to have a partition or drive that is not the / partition to back up to. This can even be a USB thumb drive depending on the size of your /.

You can set the interval to back up at. Timeshift takes incremental backups so they don't get too huge. For my home server I use Timeshift to take weekly backups and hourly backups on the current day. For my desktop, I take daily backups.

In my experience Timeshift works quite well. I recently used it to restore a system to a new physical hard drive when the sda in my home server developed too many bad sectors.

You must log in to answer this question.

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