Great tip, thank you!
Well said!
Iāve been trying to wrap my head around subvolumes, more damn subvolumes, snapper, and setting it up from scratch - for the last couple frigginā days!
And now I finally mangaged to set it up in a somewhat orderly fashion, and it seems to be coming together. Probably gained some more gray in my hair, but then I realized I havenāt had so much fun in a long time! Having been away for some time, Iād forgotten how fun Linux is, it is just the best computer game!
Obviously, before I switch, I will test whether BTRFS works for me and whether I like it. Snapshot is the biggest advantage compared to EXT4, what other advantages does it have?
compression, self-healing, subvolumes, etc
So, it is not only about taking a snapshot, but it has other important advantages. I understand compression, obviously to save space, for example, what is the significance of sub-volumes? However, what are the possible risks compared to EXT4, because it is less talked about?
This is one of the FUD message you find everywhere on the internet.
You need to know a couple of things about this:
- If you have unused RAM it is a wise idea to use it as cache. That gives you a better ROA (return on asset
)
- The ZFS cache shrinks automatically when memory pressure rises
- The maximum ZFS cache size is configurable. (zfs_arc_max). And the default value on Linux is half your RAM.
For me itās not needing to think about partitions any longer.
/ is a subvolume
/home is subvolume
/swap is a subvolume (with a swapfile in it)
Things are kept separate but still share the same physical space.
I moved my server and laptops to btrfs 5 years ago, havent regreted it once. Snapshots have saved me many times.
Agree, unused RAM is bad RAM
Compression helps with not only space but often improves performance.
Subvolumes allow you to have separate logical spaces with different rules applied to them in the same partition. This can have a few different uses:
- Allowing you to have different snapshot policies for different parts of the system
- Allowing you to keep or destroy parts of your filesystem separately
- For example, having a separate subvolume
/home
which you can preserve even when erasing/
.
- For example, having a separate subvolume
- Unlike partitions, subvolumes share space so you donāt have worry about allocating space in advance.
- They also can be used as a way to share data between distros when you multiboot
All filesystems encounter corruption but when a btrfs filesystem encounters corruption in the wrong spot, it can result in total data loss. The recent change in btrfs to default to keeping two copies of the metadata helps with this.
btrfs filesystems also require maintenance. You should be running scrub and balance jobs monthly. This can easily be automated, but it shouldnāt be ignored.
Interesting question since Iāve never used btrfs until recently. . . Is this true on Fedora also? I just let Fedora do itās thing upon install.
Yes. It is true on any distro using Btrfs.
Is balance needed even if there is only one device with BTRFS?
Also how about defragmentation? Shall one run that also on a monthly basis?
Edit: I missed the following just having a look at the ArchWiki:
On a single-device filesystem, a balance may be also useful for (temporarily) reducing the amount of allocated but unused (meta)data chunks.
I guess I should learn how to do this. Iāve never done anything for btrfs. Iāll have to look into it. Assuming itās in the fedora docs
Yes. Here is an example of the advantages of balance on a single partition filesystem.
You can schedule this as well. How often to run defrag will depend on what the physical disk is and the nature of your data.
Hahaā¦that is funny. Fedora has some of the worst documentation of any Linux distro.
The easy button for this is to install btrfsmaintenance
. Take a quick spin through the config file and ensure it is running.
I actually think their docs are pretty decent. Sometimes hard to find things, but itās all there. I will install btrfsmaintenance though
Thanks @dalto!
It has no man or help. Their github is very vague. Running btrfsmaintenance-refresh as suggested doesnāt do anything. I did get the config at /etc/sysconfig/btrfsmaintenance but thatās it. Not a great install and very unintuitive.
fstrim was already setup/enabled by default.
You modify the config there and then enable the systemd services or the cron job. There is nothing else to it.
That being said, the documentation is here:
Thanks. Ya, that was the documentation I found already and was taking about.