Recommended Btrfs Assistant configuration

After recent experiences like these ([^1], [^2]) now I fresh installed EOS with LUKS encrypted BTRFS, GRUB.

Since I’m going in this path I’ve decided to use Snapper not Timeshift for Btrfs.

I’ve installed following packages

yay -S btrfs-assistant btrfsmaintenance

sudo pacman -S snapper snap-pac grub-btrfs

Now what to do next, what are the recommended configurations/changes needs to be done for GRUB and Btrfs Assistant?

I understand it depends on your personal preference but still can you share your way of managing them and thought process so that I can take some ideas for myself.

The subvolumes are default i.e.

@, @cache, @home, @log, @/var/lib/machines, @/var/lib/portables

From Configuring BTRFS Assistant post:

I need the inotify-tools

sudo pacman -S inotify-tools

Then I’ve to do this:

Then this part is optional but I should do this:

Few questions:

  1. Why I don’t have @/.snapshots subvolume by default? Do I need to manually create it? | reference: according to @dalto it’s unnecessary. (old post though)
  2. What are the @/var/lib/machines and @/var/lib/portables? Do I need snapshots of those as well?
  3. Necessary to snapshot @cache and @log subvolumes? | reference : link
  4. What are recommended “timeline snapshots” configuration from ‘Snapper Settings’? | reference : @dalto 's recommendation here.
  5. Recommended “Btrfs maintenance setting” ?
  6. Any manual intervention necessary for snap-pac? Do I need to enable it like grub-btrfs? It suggests no configuration is needed.
  7. On plasma desktop Btrfs Assistant is in White theme as always no matter what global theme I set for the desktop. How to make it Dark?

@dalto 's preference/recommendations matters as he is one of the maintainer/dev of Btrfs Assistant :slightly_smiling_face:

I’d need to double check but I think there should be a .snapshots subvolume. I remember seeing it in my installation.

There is a section with recommendations for different use cases in the btrfsmaintenance README on GitHub.

The default time settings should be fine. Just turn on the scrub and balance tasks and leave the defrag task off. I’ve activated it for all subvolumes, but I’m not entirely sure if that is necessary or if for example @ and @home would be enough. Maybe someone else could say more about that.

snap-pac is set up to take snapshots of a snapper config named root out of the box. So if you created a snapper config for @ in btrfs-assistan that is named root and you only want to take snapshots of @, you don’t need to do anything else. If you want to also take snapshots of @home for example, you’d need to create additional configs for that. But strictly speaking @ should be enough.

For this I actually have no idea. Maybe someone else can help :slight_smile:

2 Likes

I think this is no longer necessary:

But I guess there is no harm in having it added either.

1 Like
  1. Hmm…After some snapshots it automatically created multiple of them :male_detective:
  2. Is clear
  3. So - @cache and - @log is what recommended, okay​:+1:
  1. Thanks, just checked summary. Will read their full readme.
  1. I was thinking same but not sure either. Thanks for your insights.
  2. Ok, I’ll wait for others reply.

Actually GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="rd.live.overlay.overlayfs=1" to /etc/default/grub-btrfs/config part was already there by default in latest ISO installation. Already did the sudo /etc/grub.d/41_snapshots-btrfs part. @dalto So do I need to change anything now…remove eos-dracut package or /etc/grub.d/41_snapshots-btrfs file ? Any conflicts between the two?

No actually it’s recommended to take snapshots of neither of those subvolumes. @cache is temporary stuff anyway so it’s not needed to back that up, and @log shouldn’t be backed up because when you encounter problems and revert your snapshot of @ to temporarily fix them, you usually still want to be able to look at the logs for troubleshooting. If you backup and reset the logs while reverting your root subvolume, you’ll also delete the log entries that the problem might have left, so you’ll make it harder for yourself to troubleshoot without the needed logs.

tl;dr - Just take snapshots of @ and ignore anything else. You can additionally take timed or manual snapshot of @home if you want backups of files in there, but there is no need to set snap-pac to take snapshots of @home or to revert them if you encounter problems after an update for example. For that restoring @ is enough.

I think the line is there, but it’s commented out (there is a # in front of the line which means it is ignored). Nonetheless I tested if booting from snapshots is already read-only / edits are only temporary on my identical btrfs set-up, and they are. So it definitely is working out of the box without any change needed, no matter if the line is there and uncommented by default or not.

And no you don’t need to change anything. eos-dracut and 41_snapshots-btrfs are two entirely different things and both are needed.

eos-dracut generates the initram-fs needed for booting,
41_snapshots-btrfs basically generates the sub menu that will let you select the snapshot for booting in grub itself.

Oh okay, sorry English isn’t my 1st language. Completely misunderstood it. Thankyou for re-explaining me :slight_smile:

I read somewhere it’s better to take snapshots of @home. Of course it depends on personal preference but still…

Yes you’re right, it’s ignored, I missed that​:ok_man:

Yep. Interesting…is it specific to EOS only?

Again thanks for the explanation​:+1:

Restoring @ will not restore @log and @cache will not cause those to be restored even if you take snapshots of them.

That being said, I see no value in taking snapshots of @cache. For @log, I suppose it is personal preference, I would not take snapshots of it, personally.

I would strongly recommend taking snapshots of @home. Don’t use snap-pac for those snapshots, just take them on a schedule.

2 Likes

So at this point your suggestion is to completely remove that package?

sudo pacman -Rns snap-pac

The reason I installed it because Eric Dubois mentioned in some EOS + Btrfs videos. https://github.com/erikdubois/arcolinux-nemesis/blob/master/AUR/install-snapper.sh (I installed as pacman though)

They also installed snapper-tools and snapper-support but I didn’t because of your this comment.

No, not at all. snap-pac is taking snapshots of @ before and after each update.

I am saying that for @home, you should take snapshots on a schedule. To be honest, I would also take snapshots of @ on a schedule but those are in addition to your pacman snapshots.

You have already done the setup, so there would be not point in installing snapper-support at this point.

snapper-tools is just another front-end for snapper. An opinionated one. It is up to you if you want it or not. You definitely don’t need it.

3 Likes

Ahh now I get it. :+1:

I thought snap-pac only able to take snapshots of @ not @home. So I need not to change anything.:roll_eyes: And yes taking snapshots of @home on schedule with snapper through Btrfs Assistant.
Your intention of these @home snapshots are purely for data recovery purpose not restore correct ?

I think all my doubts are clear for now, besides this one.

Yes.

You need to set the theme of the root user to be dark. One easy way to do this is using a tool like konsave.

2 Likes

You both somehow seem to have missed the second part of my comment about snapshoting @home :slight_smile:

So yeah that’s basically what I also recommended, but it’s good see that you’re recommending the same :grin:

snap-pac is able to take snapshots of other subvolumes, it’s just not set up to do so by default. Just make sure your snapper config for @ is called root and it will take snapshots of this config out of the box. Everything else you need to configure manually. So you don’t need to do anything else to not make it take snapshots of @home

And of course this is right too, my wording here was a bit off and the explanation not detailed enough. Was typing this from my phone, so please forgive me :smiley:

Happy we were able to help and clear things up for you.

2 Likes

Why not just log in as root, set the theme to dark and log out again? Nothing else should be disturbed, right?

You should never, ever, log into your DE as root.

5 Likes