BTRFS options in fstab

Hi all,

I just installed i3 with BTRFS (/) and ext4 (home)

I hope all subvolumes are there and that everything is fine and correct.

But looking on the fstab, I found this :

> UUID=C5EC-F36B                            /boot/efi      vfat    umask=0077 0 2
> UUID=cf8452a9-aa15-446c-a5af-7d27dfa1d5d9 /              btrfs   subvol=/@,defaults,noatime,space_cache,autodefrag 0 1
> UUID=cf8452a9-aa15-446c-a5af-7d27dfa1d5d9 /var/cache     btrfs   subvol=/@cache,defaults,noatime,space_cache,autodefrag 0 2
> UUID=cf8452a9-aa15-446c-a5af-7d27dfa1d5d9 /var/log       btrfs   subvol=/@log,defaults,noatime,space_cache,autodefrag 0 2
> UUID=cdea5701-4b70-4491-a314-3ae5fe9df3c1 /home          ext4    defaults,noatime 0 2
> UUID=ef02fea8-6c3e-4f72-9a55-bbd9d57e1f89 swap           swap    defaults,noatime 0 0

I dont see options for autodefrag, commpresion etc. But I didn’t have those options during the installation also :slight_smile:

What to do to make it right ?

I have SSD disk, swap partition. Any additional step which I need ?

Thx

I would change it like this:

,defaults,noatime,autodefrag,compress=zstd 0 0

The changes are:

  • Remove space_cache since kernel 5.15 forward space_cache=v2 is the default.
  • Add compression=zstd - For compression :slight_smile:
  • Change the numbers at the end to 0 0 because btrfs doesn’t support fsck
3 Likes

Directly in fstab ? :slight_smile: sorry for my noobish questions

Yes. Put that after the subvol=whatever part because that is different on each mountpoint.

1 Like

Is it ok now ?


UUID=C5EC-F36B                            /boot/efi      vfat    umask=0077 0 2
UUID=cf8452a9-aa15-446c-a5af-7d27dfa1d5d9 /              btrfs   subvol=/@,defaults,noatime,autodefrag,compress=zstd 0 0
UUID=cf8452a9-aa15-446c-a5af-7d27dfa1d5d9 /var/cache     btrfs   subvol=/@cache,defaults,noatime,autodefrag,compress=zstd 0 0
UUID=cf8452a9-aa15-446c-a5af-7d27dfa1d5d9 /var/log       btrfs   subvol=/@log,defaults,noatime,autodefrag,compress=zstd 0 0
UUID=cdea5701-4b70-4491-a314-3ae5fe9df3c1 /home          ext4    defaults,noatime 0 2
UUID=ef02fea8-6c3e-4f72-9a55-bbd9d57e1f89 swap           swap    defaults,noatime 0 0

Looks good to me.

3 Likes

Just a dumb question on this. What is the point of using btrfs file system if you are aren’t using timeshift and snapshots or snapper? Just for my own thinking? Or is there no reason to use it otherwise over ext4?

Just off the top of my head:

  • Subvolumes(volumes which share space but can be managed separately)
  • Transparent compression
  • Easily expand volumes across drives
  • Copy on write
1 Like

Hi,

I am using Timeshift and btrfs snapshots :slight_smile:

1 Like

I recently read (I think it was Linux Format) that btrfs actually outperforms ext4 in some measures - which is not something I expected to see! I wouldn’t make a change based on that, though.

Personally, if zfs can be made more accessible - then as I learn more of its capabilities I can add them in as fits my use. It apparently can do everything!

1 Like

If there is interest, I could make an unofficial zfs ISO once the new ISO is released.

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.