Btrfs Assistant 1.0 is coming, testers needed

Yes.

Yes.

You can use a single partition or two different partitions. In the latter case, they can both be btrfs or different filesystems.

For me, personally, if I could only have btrfs snapshots in one place, it would be on my personal data.

2 Likes

I just installed EndeavourOS with BTRFS and I am also running the BTRFS Assistant. I have a question about the BTRFS maintenance tab, as I couldn’t find easy to understand information. How do I decide to which mount points to apply the Balance and Scrub operations. I saw in one of the screenshots in this thread that all the mount points were selected, but somewhere else I read that the default settings of the Assistant should be sufficient for most users and the default, in my case, is just / (apart from that I also have /home, /var/cache, /var/log and /run/BtrfsAssistant...).
If the logic behind what is to be selected is explained somewhere, I might have missed it, so you can just give me a link to that.

Balance and scrub apply to the entire filesystem. Btrfs commands are a little strange the way they are implemented. They take a path but don’t always act on that specific path. Sometimes they just use that path to locate the correct filesystem.

Unless you have more than one filesystem, you only need to select one mount point.

2 Likes

Thank you for the information. EOS is taking a whole SSD on its own with its Btrfs installation. I have a separate SSD with Windows on it, but I guess I shouldn’t worry about that (standard dual-boot system with 2 separate EFI partitions on the 2 separate SSDs) so I think then the default settings are good for me.

1 Like

This is not normal at all. For me, with Btrfs and snapshots, it’s a little over 17 GB. Home included (but contains only the dotfiles, data are linked from a HDD.

I think they meant that the whole drive is allocated to EOS, not that it is full.

That comment was in response to me talking about having multiple filesystems.

sorry, misunderstanding

2 Likes

@dalto I have few questions and help with Ubuntu based distros for another laptop. Should I post it on github or where is adequate place for that :smiley:

It doesn’t matter to me. You can ask on gitlab or in one of the many forums I frequent.

1 Like

On Ubuntu everything seems messed up.

this is /etc/fstab :

UUID=E01B-0641                            /boot/efi      vfat    defaults   0 2
UUID=f89930fd-5f14-48ff-8ed4-413e4ea86173 /              btrfs   subvol=/@,defaults,noatime,autodefrag 0 0
UUID=f89930fd-5f14-48ff-8ed4-413e4ea86173 /swap          btrfs   subvol=/@swap,subvol=/@swap,defaults 0 0
UUID=4292804b-d282-4903-bdf6-e1f6e360dfbb /home          btrfs   defaults,noatime,autodefrag 0 0
UUID=27b4037e-7c00-47ba-8c9d-8b562fb9c9b6 swap           swap    defaults   0 0
/swap/swapfile                            swap           swap    defaults   0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0

and this is lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1     259:0    0 953,9G  0 disk 
├─nvme0n1p1 259:1    0     1G  0 part /boot/efi
├─nvme0n1p2 259:2    0 156,3G  0 part /swap
│                                     /
├─nvme0n1p3 259:3    0 781,3G  0 part /home
└─nvme0n1p4 259:4    0  15,4G  0 part [SWAP]

So I have

  • fat32 as boot/efi
  • btrfs as (/)
  • btrfs as (home)
  • swap partition

At first I tried with btrfs-assistant but it didnt worked , it took wrong image.

This is second install, but still seems wrong or ? can you check please ?

I am not sure what you mean. What is the problem you are having? Nothing there looks messed up.

Well…having this twice is wrong but it shouldn’t cause any issues.

Is this better ?

UUID=E01B-0641  /boot/efi  vfat  defaults  0 2
UUID=f89930fd-5f14-48ff-8ed4-413e4ea86173 /              btrfs   subvol=/@,defaults,noatime,autodefrag 0 0
UUID=4292804b-d282-4903-bdf6-e1f6e360dfbb /home          btrfs   defaults,noatime,autodefrag 0 0
UUID=27b4037e-7c00-47ba-8c9d-8b562fb9c9b6 none           swap    sw       0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0

Problem is when I made backup via btrfs-assistant, during restore it restored only base ubuntu, not xubuntu. While timeshift restored correctly

autodefrag on btrfs? Is that good?

I dont know. it is default from install. didnt changed anything. but yeah, looks different than on my laptop with Eos.

If you have the system on an SSD, I would rather do without autodefrag. Too many unnecessary writes. That is a disadvantage of Btrfs that it tends to fragmentation rather than ext4.

1 Like

So removing autodefrag is enough ? Anything else ?

I would say yes, but the btrfs guru is @dalto. He will tell you what is better.

1 Like

You might want to run a compress on your file system and then enable it via fstab.

I think EnOS uses compress=zstd in /etc/fstab.

For more, see: https://wiki.archlinux.org/title/Btrfs#Compression

1 Like

Yes, this is my fstab after an automatic installation:

UUID=10A9-4D9C                             /efi         vfat    defaults,noatime 0 2
UUID=72a52d21-8e95-40d9-80e4-ab878be9bacb  /            btrfs   subvol=/@,defaults,noatime,compress=zstd 0 0
UUID=72a52d21-8e95-40d9-80e4-ab878be9bacb  /home        btrfs   subvol=/@home,defaults,noatime,compress=zstd 0 0
UUID=72a52d21-8e95-40d9-80e4-ab878be9bacb  /var/cache   btrfs   subvol=/@cache,defaults,noatime,compress=zstd 0 0
UUID=72a52d21-8e95-40d9-80e4-ab878be9bacb  /var/log     btrfs   subvol=/@log,defaults,noatime,compress=zstd 0 0
UUID=72a52d21-8e95-40d9-80e4-ab878be9bacb  /swap        btrfs   subvol=/@swap,defaults,noatime 0 0
/swap/swapfile                              swap        swap    defaults 0 0
UUID=caf40634-610f-4992-b2db-16d556eaf403  /mnt/data    ext4    defaults,noatime 0 2
tmpfs                                      /tmp         tmpfs   defaults,noatime,mode=1777 0 0
1 Like

I may not be fully understanding your meaning, but if you wish to restore the contents of /home you will need to explicitly do that (separately from restoring /). This is because Snapper allows for subvolumes to be restored independently from one another. I believe with Timeshift it rolls back everything together.

The reason defragmentation is generally not recommended on an SSD is because–as you mentioned–it costs a write, and for many filesystems does not provide a benefit. It’s not inherently problematic, just not really helpful and somewhat wasteful since excessive writes is exactly why SSDs die.

For Btrfs, however, there is a benefit to defragmentation because the more the filesystem is used, the more numerous and complex all of the extents Btrfs is tracking become . If you never defragment your Btrfs filesystem it will probably still work, but it will be slower and more work for your CPU than necessary because even a small transaction can translate to a lot of IOPS.

https://btrfs.wiki.kernel.org/index.php/Gotchas#Fragmentation

https://btrfs.readthedocs.io/en/latest/Defragmentation.html

The cost of adding a write to the disk may be less significant than in years past as well, especially for the typically modest use an SSD gets from an average user running a computer at home. Many people run an SSD for years and years before the disk needs replacement from excessive writes. Taking a CPU performance penalty for all those years just to avoid adding a write to the disk once in a while does not seem worth it to me.

I guess it is really up to the user what they would like to do, whether they would rather be conservative with writes to the disk or would rather get the benefits of defragmentation and better performance. Probably most folks will not notice a difference either way.