Configuring BTRFS Assistant

I just made a fresh install (BTRFS, Grub, KDE).
If you all remember the discussions about Baloo reindexing snapshots and giving multiple search results for the same file plus an ever growing index.
As per other thread(s) I communicated with the KDE forums about this https://discuss.kde.org/t/baloo-btrfs-reindexing-sanpshots/18989

It appears to me the issue was that the snapshot(s) folder should be excluded from Baloo index.

So, I decided a fresh install and did a few modification to the system, mainly excluding all hidden folders, snapshots, and hidden files in the Baloo config file from being indexed.
As well, I did what I once did some time ago and created a hook to look after Grub so it won’t break.
Details are there in this thread Baloo, BTRFS, Reindexing Snapshots

I read a lot here in the forum about BTRFS Assistant, Snapper, etc… and I created a “root” config in the BTRFS Assistant.

As I am keen to do it perfectly and avoid snapshotting my /home folder, and given that I am not that techie and I want to avoid doing something that may cause an issue with Baloo or file search, I would like to ask the experts here and especially @dalto about the best setup and configuration for BTRFS Assistant that just works.
I want to:
- have snapshot before any update or installation of any software.
- Avoid snapshotting my /home folder so not to have these issues discussed
- Be able to boot from Grub to previous snapshots. (should I install something for this? grub-btrfs if I remember correctly?)

Looking at No snapshots founds in grub-btrfsd adds to my confusion a bit, should I install grub-btrfs, grub-btrfsd, inotify…?
I just feel I am at a critical stage that will make it or break it. So I do not want to rely on my humble and non techie understanding.

I will highly appreciate your feedback.
The following pics show how is my BTRFS Assistant.
I notice in one of the pics that there was a snapshot when I installed the cron stuff.
So, I wonder if I need to modify anything?






The snapper boot timer you have enabled takes a snapshot every time you reboot your machine. If you don’t need that you can uncheck that.

Also, you probably don’t want to retain your snapshots of root for 10 years. I would probably set yearly to 0.

If you want to boot off of snapshots you need install and configure grub-btrfs.

1 Like

@dalto here for wonderful support as usual.

These were the defaults. I will modify them.

So I have to install grub-btrfs and that’s all I need? no grub-btrfsd or any other stuff or configuration?

I will appreciate if you review what I did in m other thread (and what I want to do.)

According to my humble understanding it seems to me that it is already working and taking snapshots as per the pic below.

I hope you tell me I am fine now.
I will install grub-btrfs now, and hope you tell me if I need to install/configure anything else? It won’t affect the hook that looks after Grub?
EDIT:
How to configure grub-btrfs? I couldnt find an app to do it? Is it command line?

FYI:
I already created a file with one word “abracadabra” inside, long before the snapshots were taken. and searching I am getting only one result not multiple results as before.

Just remains how to configure grub-btrfs.

Thank you @dalto for all you wonderful and knowledgeable support.

Install snap-pac.

sudo pacman -S snap-pac

Put /home in a separate subvolume. If you are using the default subvolume layout, this should already be done for you.

Install grub-btrfs and inotify-tools.

sudo pacman -S grub-btrfs inotify-tools

Enable the grub-btrfs daemon so new snapshots are automatically added to the Grub menu.

sudo systemctl enable --now grub-btrfsd

Regenerate the Grub configuration file.

sudo grub-mkconfig -o /boot/grub/grub.cfg

You may wish to add GRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="rd.live.overlay.overlayfs=1" to /etc/default/grub-btrfs/config for booting snapshots read only. See here for more information about that: https://github.com/Antynea/grub-btrfs/blob/master/initramfs/readme.md#dracut-based-distros

Afterward, regenerate a new snapshot submenu.

sudo /etc/grub.d/41_snapshots-btrfs

Reboot and test that you are able to boot to a snapshot from Grub.

3 Likes

Installed and did the commands.
Rebooting!
P.S.
Would it keep automatically creating a new entry for each snapshot?
Have you checked in the other thread the hook I did to look after Grub?
Would it be affected?

UPDATE:
Amazing.
Rebooted. I could see an entry at the end of the boot menu having all snapshots. (though its font is so tiny, I wonder how can I enlarge it a little. I could hardly read it, I actually guessed what was written)

Probably this should help: https://wiki.archlinux.org/title/HiDPI#GRUB

2 Likes

Yes, that is what the grub-btrfs daemon does.

The hook reinstalls the Grub bootloader and regenerates the Grub configuration file whenever the Grub package is updated.

Your question is kind of unclear, but it should be fine to use that hook with this setup.

You must have a 4K screen or something. I have a test machine here where the menu looks like this:

:point_up: Yes, that’s perfect. Either changing the resolution or changing the font size should work. Just whatever you do, don’t follow the “tip” in the green box where it suggests using Grub Customizer! :scream: [FAQ] Why you should NOT use grub-customizer

1 Like

Thank you @BluishHumility. Thank you @Whyhow
I just tried and searched, I just tried to do my homework.
I already changed the font as follows: (I hope it will help others)

  • I downloaded .pf2 fonts from https://store.kde.org/p/2103582
  • `sudo cp /home/limo/TempDownload/grub-unifont-font-more-sizes/unicode40.pf2 /boot/grub/fonts/
    (depends on your folders)
  • `sudo grub-mkconfig -o /boot/grub/grub.cfg
  • reboot
    And I got a nice large font for the Grub menu.

Again, this distro, this forum is amazing.
The initial issue (in the other thread and many other threads) was Baloo was not playing well with BTRFS and snapshots.

It was much simpler solution than all what I previously tried to do.
Simply modify the Baloo config file to exclude the snapshot folder as detailed in the other thread.

Now, I am having several snapshots and getting only one search result for the file(s) not many as before.

2 Likes

I never had to do this. :thinking:

If I remember correctly you have very few files.
But for me I have a lot many files.
I have tried BTRFS, Sanpper before and I had the issue of multiple results all pointing to the same file.
See how many files I have:

[limo@eos ~]$ balooctl6 status
Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.
Baloo File Indexer is running
Indexer state: Indexing file content
Indexing: /home/limo/Books/Managing Investment Portfolios ( PDFDrive ).pdf
Total files indexed: 4,264
Files waiting for content indexing: 609
Files failed to index: 0
Current size of index is 1.09 GiB
[limo@eos ~]$ 


over 4000 files!
I admit some of them are really small text files created by a hierarchical note taking app that saves every note as a text file on its own But these are in tens not even hundreds.
As I said I read like crazy and I do my own research as well. PLUS manuals, invoices… etc.

I wonder how is it if you created one unique file say xyz.tx with one unique word “abracadabra” then take a some snapshots and search and see ho wmany results you will get!

By the way what is this that appears on top:

Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.

What’s wrong and how to fix!
Update:
I think I fixed it as in Inxi -Fxxx Strange Locale Settings

Honestly I don’t think having 4000 files should cause multiple entries. But what do I know? Not much! :laughing: Anythings possible. :wink:

It happened actually before. I some time ago installed with BTRFS, Snapper. KDE… etc… you will find old threads. I remember one of them was about using Recoll and disabling Baloo. I used to have multiple results all pointing to the same file. Simply Baloo was indexing snapshots all the time.

That was before … this is now. True i don’t have a bunch of files but it just seems odd to me. :person_shrugging:

It seems you are right!
I played with baloo a little and removed the config file, it was recreated with excluding the snapshots by itself.

[General]
dbVersion=2
exclude=/.snapshots

Mine shows this if i have the right file?

[General]
dbVersion=2
exclude filters=*~,*.part,*.o,*.la,*.lo,*.loT,*.moc,moc_*.cpp,qrc_*.cpp,ui_*.h,cmake_install.cmake,CMakeCache.txt,CTestTestfile.cmake,libtool,config.status,confdefs.h,autom4te,conftest,confstat,Makefile.am,*.gcode,.ninja_deps,.ninja_log,build.ninja,*.csproj,*.m4,*.rej,*.gmo,*.pc,*.omf,*.aux,*.tmp,*.po,*.vm*,*.nvram,*.rcore,*.swp,*.swap,lzo,litmain.sh,*.orig,.histfile.*,.xsession-errors*,*.map,*.so,*.a,*.db,*.qrc,*.ini,*.init,*.img,*.vdi,*.vbox*,vbox.log,*.qcow2,*.vmdk,*.vhd,*.vhdx,*.sql,*.sql.gz,*.ytdl,*.tfstate*,*.class,*.pyc,*.pyo,*.elc,*.qmlc,*.jsc,*.fastq,*.fq,*.gb,*.fasta,*.fna,*.gbff,*.faa,po,CVS,.svn,.git,_darcs,.bzr,.hg,CMakeFiles,CMakeTmp,CMakeTmpQmake,.moc,.obj,.pch,.uic,.npm,.yarn,.yarn-cache,__pycache__,node_modules,node_packages,nbproject,.terraform,.venv,venv,core-dumps,lost+found
exclude filters version=9

Maybe I was wrong and I did not really remove the config file! I don’t know.
But try a unique file with a unique word and take some snapshots and see and let me know please.
I am just curious.

1 Like

I’m not sure if I’m doing the search like you are because the file i create is in my /home. So it finds it right away if i use content your files. Only finds the file that exists in /home nothing to do with snapshots. So like i said before I’m not exactly sure what it is you are doing for this to happen.

I said it happened before. But now it is ok. One example of a search result https://www.reddit.com/r/kde/comments/r966wl/psa_baloo_is_broken_on_btrfs_partition_with/
There was a bug (several bugs actually) filed with KDE https://invent.kde.org/frameworks/baloo/-/merge_requests/169

Baloo excludes hidden files and directories by default and doesn’t index outside your home folder by default

I see this now @lorebett
But before that it was reindexing snapshots all the time. You will find several threads by me about this. One of them when I tried (and did) use Recoll instead of Baloo. Make Dolphin Use Recoll "kio_recoll" Installed
Celebrating 1 Month BTRFS and 2 Months on EndeavoursOS