What cool things can I do with the btrfs file system?

I’ve never used btrfs before and now all my drives are using it. Are there any really cool things I can do with the file system? I’m not entirely sure I understand copy on write but I get the understanding it means more reliable file transfer? Furthermore I’ve heard that OpenSUSE takes snapshots of your computer when you install updates. Does that take up a lot of room? I have quite a few files on my computer and storage drives.

by Default only the system files are snapped. BTRFS uses snapper to maintain old images. But do not think of them as backups they are not they are images that let you set system things back in time ie revert. They do take a bit of space and you should allow a minimum of 40 gig for a normal root file system. Many prefer more. BTRFS has many option but be warned that some are still experimental :open_mouth: https://en.opensuse.org/SDB:BTRFS

Many directories are setup as sub-volumes.

Also by default home directory is set as a Sub-volume of root unless you change it. Personally I prefer to keep my data on a separate partition from system but the developers have seemed to have fallen lin love with BTRFS sup-volumes:P
.

Thank you for your reply. Ah, I see. Snapshots make more sense now.

I have a /home partition on a completely different drive to / because at the time I thought I might be playing the odd game here and there and wanted to keep things organised.

Sub-volumes does sound interesting. This is going to be a really stupid question but what is the point of a sub-volume? Why not do it the old fashioned way and just create directories? I don’t understand the benefits of sub-volumes and I feel I should.

I feel the same way so don’t use BTRFS. If I should ever move to TW I would for the snapshots help on an OS that breaks a bit. Not often but sometimes. On Leap I just go on using ext4 which works just fine and I have never felt the need to rollback. Remember it is just the default you do not have to marry it.

Fair enough. Thank you for your thoughts.

An advantage of subvolumes, besides snapshots, is that you can have independent organization divisions of your drive(s) without having to estimate beforehand how much space to allocate to your partitions. For example, / and /home can be in separate subvolumes on the same drive, both able to allocate their storage needs from the same pool of space. So, if / grows faster than you expected, but /home does not, you do not have to stop and rebuild your partitions to give more space to it.

Another advantage is you can have multiple drives’ storage concatenated into a big btrfs, using raid0 configuration. There are other possible raid-type configurations, too.

If you send your read-only snapshots to off-system storage, and you need to use them for recovery, you can simply send them back, then make a read-write snapshot of the read-only snapshot, and that can become your recovered “real” subvolume with a simple mv command.

Overall, btrfs just makes your storage management easier. You have to learn it, of course.

snapper does not “snap” files - it creates snapshots of subvolumes. By default only root subvolume is configured for automatic snapshots.

I’ve collected what I believe to be the best/better references for all things BTRFS…
ie.
Commands that should be used to inspect and manage the usage and size of your BTRFS filesystem,
The relatively new BTRFS RAID for both small and large arrays of disks (do not configure RAID5 or 6 for more than a few disks due to a RAID parity bit bug).
And more

https://en.opensuse.org/User:Tsu2/systemd-1#BTRFS

TSU

The subvolumes can be mounted with different parameters (like nodatacow for VMs and databases, noatime, etc.). Out of the box, SUSE segments system directories onto separate subvolumes so that they’re not included in system snapshots, which facilitates rollbacks, etc. This is a big reason why I’m on SUSE :good:

As mentioned, the off-site snapshot transfers can be a great backup tool.

Also, I like to keep my data in a BTRFS raid1 array to make use of the autocorrection as a protection against file corruption. Backups are only helpful if you realize a file’s been damaged. This works even with two partitions on the same disk.

The RAID arrays aren’t optimized for speed but they are extremely flexible and easy to understand. You can make a raid1 across any number of disks or partitions.

The biggest downside to BTRFS that I’ve seen is that snapshots will fill up your disk and standard disk managers can’t accurately assess usage or warn you. My Tumbleweed install was freezing for 10-20m at a time before I realized I was out of space.

Read “man 5 btrfs” and do not spread false information. nodatacow applies to the whole filesystem.

Have this in mind: https://btrfs.wiki.kernel.org/index.php/Manpage/mkfs.btrfs#DUP_PROFILES_ON_A_SINGLE_DEVICE

To add to others have said already, I enable hourly snapshots on /home, so I could recover from an accidental deletion, as long as the files were on disk for more than 1 hour. Besides, people like to use the compression feature if space is tight, which probably leads to faster reads as well.