How to backup dom0?

Hello. Is there a way to back up dom0 environment? I have tons of dom0 customization that aren’t included in /home/user directory, like zram.service and custom rpc policies for example, and I’d like not to spent day(s) after restoring/reinstalling it on a same machine.

The built-in backup utility looks like it can backup dom0.

I’m asking different question.

Unfortunately (currently) there is not a dedicated integrated tool for this. And people are currently resorting to workarounds to backup various portions of their (non in dom0 $HOME) customization. For example their custom salt formulas in /srv, etc.

This could be a form of custom automatic scripts to create a tar file of their custom files in their home dir; to have the dom0 root formatted as BTRFS sub-volume (so it could be used with btrfs snapshot/send/receive). And many alternative solutions. I believe if you search in the forum, you will find many creative ideas.

Ah okay sorry. In that case, this thread might help?

Thanks for the reply. I did actually search the forum prior to posting the topic (and read the docs, obviously), but didn’t find anything beside manual copying files or overcomplicated taking snapshots, which @marmarek doesn’t recommend anyways.

I am sure, though, that I missed some ideas, so please share them if you’re aware of some I didn’t mention.

Thank you in advance.

1 Like
  1. For files which could be owned by user but should reside at a place other than $HOME, it is easy. Just create hardlinks.
mkdir ~/Backup
ln /etc/qubes/policy.d/30-user-custom.policy ~/Backup/30-user-custom.policy

Please take note that strictly ownership of all files in user $HOME (and hence the original hardlinked file) will be changed to current user after each dom0 backup. This is integrated into the Qubes Core backup logic.

  1. The automatic backup of some files on each login (or shutdown, …) could be achieved via .profile or a systemd unit, etc.
mkdir ~/Backup
echo /etc/qubes/policy.d/30-user-custom.policy >> ~/Backup/backuplist.txt
echo /srv/salt >> ~/Backup/backuplist.txt
echo "sudo tar -cvzf ${HOME}/Backup/backup.tar.gz -T ${HOME}/Backup/backuplist.txt" >> ~/.profile
  1. If you need a custom feature; for example a custom file at user $HOME containing list of files outside user home directory which core backup logic should include in backups, then please consider opening a feature request on Github.
2 Likes

Thanks for the ideas. It’ll help me for sure to develop some steps to make it less manual. Unfortunately and considering Qubes developing HR and the number of users that might be interested in, most probably the request wouldn’t be worth the “paper it’d be written on”, regardless the fact that there is so much talk about backing up the Qubes, and it’s mostly focused on qubes, whih is pretty good covered anyway, but not so many users actually emphasizing/noticing the weakest link of the Qubes Backup tool - backing up dom0, unlike any other OS…

I am interested on the above. And asking from a Qubes OS user to a Qubes OS user, why do you believe that the request would be ignored and even no community developer might consider it.

Thanks for asking. I just explained it: the lack of developers while they are aware of the issue (at least @marmarek is), not many users interested in, so not much hopes to get to the top of the priority list.

Just real, I think I am.