Is possible to install packages in another subvolume with BTRFS?
I noticed that when I restore a snapshot for /home subvolume, this causes a problem with Firefox profile/history and profile sync daemon.
This problem also happens with Signal application, in which some messages are lost.
So, basically what I in theory need is to create a new subvolume, and change the path dir from these two applications from /home to a new location?
I have a subvolume at the root of the BTRFS partition for my Firefox configs/profiles called @mozilla which I mount at ~/.mozilla.
I do have another called @var for my flatpaks configs which gets mounted at ~/.var.
I have done so in order to being able to share the configs between several systems in a multiboot setup.
It works fine.
Not sure though if that is what you are looking for to do.
This is exactly what I’m looking for but for other purpose, which is to be able to restore a snapshot for /home subvolume and don’t affect this two applications, which would be stored in different subvolume.
You might perhaps want to make a backup of those configs somewhere else before moving them around.
You never know so it’s better to play it safe. Good luck!
The first is to use flat subvolumes. Basically create new subvolumes at the root of your btrfs partition and then mount them in /etc/fstab or with mount units. This is what @pebcak has described.
You can also create a nested subvolume. In this case you would just create a subvolume at /home/myuser/.mozilla. In this case, you would not need to mount anything. It “just works”.
Thanks Dalto and pebcak, this will save me from headaches when restoring /home subvolume.
Based on what has been said here, I’ll try the nested subvolume approach first, it sounds easier than having to boot into live USB, mount the subvolid 5, create the subvolume and configure it into fstab.
I think nested is a good choice if I understand your use case. That being said, you only need to mount the live ISO if you are moving data that you can’t change in a running system. In this case, that shouldn’t be required.
Its working
1- systemctl --user stop psd
2 - Backup of the folder ~/.mozilla
3- removed the folder
4- created a subvolume with btrfs subvolume create .mozilla inside /home/myuser (without sudo)
5- changed the permissions to chmod -R 700 /home/myuser/.mozilla
6- copied with cp -R /mybackup/.mozilla/extensions and /mybackup/.mozilla/firefox to the new folder and its working perfectly