First draft: 15OCT2014
Purpose
This page contains my notes on BTRFS. I hope that others may find it useful.
This page will be updated as I gather more info.
If you have useful info please contact me.
Rationale
openSUSE, my Linux distro of choice, has adopted BTRFS as the default files system for openSUSE 13.2. I’m trying to understand the reason(s) behind this decision and whether or not I want to use BTRFS. I currently use EXT4.
Scope
Average desktop and laptop use. This is for openSUSE only. Also, I am not interested in any server usage scenarios.
You Should Know
I am not a Linux expert nor am I well-versed in file systems. I’m just your average curious Geek.
Links
PLEASE see the links at the bottom of this article.
BTRFS?
Btrfs is a new copy on write (CoW) filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. (BTRFS Wiki)
CoW?
Stands for copy on write.
“When data is overwritten in an ext4 filesystem, the new data is written on top of the existing data on the storage device, destroying the old copy. Btrfs, instead, will move overwritten blocks elsewhere in the filesystem and write the new data there, leaving the older copy of the data in place…Copy-on-write also enables some interesting new features, the most notable of which is snapshots.” (LWN.net)
Snapshot?
“A snapshot is a frozen image of all the files and directories of a subvolume. For example, if you have two files (“a” and “b”) in a subvolume, you take a snapshot and you delete “b”, the file you just deleted is still available in the snapshot you took. The great thing about Btrfs snapshots is you can operate on any files or directories vs lvm when it is the whole logical volume.
Note that a snapshot is not a backup: Snapshots work by use of btrfs’s copy-on-write behaviour. A snapshot and the original it was taken from initially share all of the same data blocks. If that data is damaged in some way (cosmic rays, bad disk sector, accident with dd to the disk), then the snapshot and the original will both be damaged. Snapshots are useful to have local online “copies” of the filesystem that can be referred back to, or to implement a form of deduplication, or to fix the state of a filesystem for making a full backup without anything changing underneath it. They do not in themselves make your data any safer.” (BTRFS Wiki)
( Ahem: See where it says “a snapshot is not a backup”?! )
&
“A snapshot is a virtual copy of the filesystem’s contents; it can be created without copying any of the data at all. If, at some later point, a block of data is changed (in either the snapshot or the original), that one block is copied while all of the unchanged data remains shared. Snapshots can be used to provide a sort of “time machine” functionality, or to simply roll back the system after a failed update.” (LWN.net)
&
From openSUSE Snapper “Help”
“The table shows a list of root filesystem snapshots. There are three types of snapshots, single, pre and post. Single snapshots are used for storing the file system state in a certain time, while Pre and Post are used to define the changes done by special operation performed between taking those two snapshots. Pre and Post snapshots are coupled together in the table.
Select a snapshot or snapshot couple and click Show Changes to see the new file system changes in the specified snapshot.”
Windows users may be familiar with Volume Shadow Copy Service which is used for System Restore and Windows Backup. These are snapshots too.
Snapshots are kept in subvolumes.
Subvolumes?
Starting to get confused? Yeah, it gets worse.
Subvolumes are what you make snapshots of.
Subvolumes are also where snapshots are stored.
So, you need a subvolume to make a snapshot of a subvolume and you can take snapshots of snapshots 😯 aaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhh!
So, What Are The Advantages Of BTRFS?
Actually, you are going to have to do some reading. I recommend starting here: The Btrfs filesystem: An introduction
In a nutshell, BTRFS seems to being sold to us as an easy to repair file system as well as being able to handle large/multiple disks/volumes well.
Benchmarks
I did some a few weeks ago for whatever they are worth.
Phoronix
Linux 3.14 File-System HDD Benchmarks
8-Way Linux 3.13 File-System Benchmarks
More: Phoronix Storage
linuxfoundation.org
Btrfs – Current status and Future Prospects (Oct 13 2014, Satoru Takeuchi, Linux Development Div. Fujitsu LTD)
Linux File System Analysis for IVI Systems (July 1, 2014, Mitsuharu Ito, Fujitsu Computer Technologies, Ltd)
(note – while there is some great info in the above 2 links, much of it applies to enterprise type storage).
Benchmarks are all over the map. Statistically I would call ext4 v. btrfs even for desktop/laptop users.
Why Is opneSUSE Defaulting To BTRFS? (warning, opinions ahead…)
I don’t know. AFAIK nobody at openSUSE has explained it. Certainly they offer almost no usable end-user info on BTRFS.
I definitely understand the benefits for enterprise type storage. Maybe they are using us as beta testers to further that development.
Lennart Poettering, creator of systemd and PulseAudio, seems to think that BTRFS and systemd have a beautiful future together so maybe thats it. Now, he and systemd are extremely controversial in the upper echelon Linux circles. That’s “beyond my pay grade”. I can say that for years PulseAudio screwed with my systems. :banghead:
Personally I see no benefit for me using BTRFS at home. As they say here in the South, “splain it to me” 😉
In any event I think openSUSE defaulting to BTRFS is somewhere between a major mistake and just plain rude.
Oh, and if BTRFS is so awesome why is open SUSE 13.2 using XFS for /home?
Working With BTRFS
Frankly, managing this stuff is overly complicated.
You can view, create, and edit BTRFS via YaST > System > Partitioner. You can also add / remove subvolumes here: Edit the BTRFS partition > Subvolume handling > choose Add new or Remove.
To Create, Modify, Delete, or Restore snapshots you use Snapper: YaST > System > Miscellaneous > Snapper .
Us average Geeks might be able to figure out which snapshot to use in the event of a problem (if we can actually boot up). Then again, maybe not.
See: Snapshots/Rollback with Snapper
opeSUSE Default Subvolumes
I’ve no idea why these specific subvolumes are created.
( command to view all subvolumes = btrfs subvolume list / )
boot/grub2/i386-pc
boot/grub2/x86_64-efi
home
opt
srv
tmp
usr/local
var/crash
var/lib/mailman
var/lib/named
var/lib/pgsql
var/log
var/opt
var/spool
var/tmp
.snapshots
Tweaks
Before we get started here. The ONLY backup program I am interested in is a disk image, PERIOD.
Yes, this renders the btrfs snapshot (and subvolumes) feature useless for me. (See: Btrfs: Subvolumes and snapshots )
BTRFS tweaks I use (See: https://btrfs.wiki.kernel.org/index.php/Mount_options )
discard,noatime,nodatasum,space_cache,ssd
On one install there are NO subvolumes and snapshotting is disabled.
On the install with default subvolumes and snapshotting enabled I’m using:
discard,noatime,ssd
AFAIK, by default these mount options are passed on to the subvolumes.
On systems with subvolumes/snapshots disabled I’ve also used nodatcow in place of nodatasum. This implies no compression.
Disc Image Backup
I was little leery of BTRFS because it’s new-ish and my main backup program (Acronis TI) doesn’t support BTRFS. So the first thing I did after installing openSUSE 13.2 beta1 is use Clonezilla to backup and restore the drive. Everything went perfect :cooler:
When I say TI doesn’t support BTRFS, I mean to say it doesn’t officially support it. The TI boot disk is Linux so I don’t understand why it wouldn’t work. Will report on this when I have time. (as of this writing TI2015 boot disk is using Linux kernel 3.11.6)
Wanted – A Windows BTRFS Driver
OK, I know this isn’t the kind of scenario many people will relate to, but…
Recently I did some drive swapping on my triple boot computer (win7, win8.1, opesuse 13.1). I had forgotten to edit my fstab beforehand and on boot openSUSE had a hissy fit that some of the partitions in fstab were nowhere to be found and refused to boot. No problem, I booted into Windows 7, mounted my Linux partition with Paragon ExtFS for Windows, opened fstab with Notepad++ and edited out the offending entries, rebooted to openSUSE. Problem solved in 2 minutes!
LINKS
Slashdot – OpenSUSE 13.2 To Use Btrfs By Default (first comment, “Finally someone who beta tests btrfs for me!“)
LWN.net – The Btrfs filesystem: An introduction
DistroWatch – Advantages and benefits of ZFS and Btrfs over ext4
-END-