Changes to BtrFS between r13 and r25

''Butter Filesystem.  Hold the toast.''

I've started experimenting with ''BtrFS'' which aims to provide an "advanced and modern filesystem" (heavily compared to ZFS) on Linux.  With my new workstation I've started using BtrFS for my home directories (`/home`) and my build directories (`/mnt/slackbuilds`) to gain exposure to the filesystem and compare it to ZFS and EXT4 on LVM (all of my other data, including my root disk is on EXT4 on LVM).

I have used ZFS heavily in the past, and using BtrFS is significantly different as many of the fundamental concepts are different.  BtrFS has no concept of "pools" or "volume groups" -- instead there are "volumes."  BtrFS has no concept of "datasets" or "logical volumes" -- instead there are "subvolumes".

Here's a comparison between [http://hub.opensolaris.org/bin/view/Community+Group+zfs/WebHome | ZFS], [https://btrfs.wiki.kernel.org/index.php/Main_Page | BtrFS], and [https://ext4.wiki.kernel.org/index.php/Main_Page | EXT4] on [http://sources.redhat.com/lvm2/wiki/ | LVM]:
(blank line)
'''General'''
%|                                    | ZFS                               | BtrFS                            | EXT4 and LVM                                    |%
&| '''Commands Involved'''            | `zpool`, `zfs`                    | `mkfs.btrfs`, `btrfs`            | `pvcreate`, `vgcreate`, `lvcreate`, `mkfs.ext4` |&
&| '''Can be Boot filesystem'''       | Yes                               | No                               | No                                              |&
&| '''Pool of disks'''                | "zpool"                           | "volume"                         | "volume group"                                  |&
&| '''Mountable unit'''               | "dataset"                         | "volume" and "subvolume"         | "logical volume"                                |&
&| '''License'''                      | CDDL                              | GPL                              | GPL                                             |&
&| '''Can be Boot filesystem'''       | Yes                               | Yes (grub 2.00)                  | No                                              |&
&| '''Can be Root filesystem'''       | Yes                               | Yes                              | Yes                                             |&
&| '''Can provide swapspace'''        | Yes (zvols)                       | No                               | Yes (lvm)                                       |&
&| '''Pool of disks'''                | "zpool"                           | "volume"                         | "volume group"                                  |&
&| '''Mountable unit'''               | "dataset"                         | "volume" and "subvolume"         | "logical volume"                                |&
&| '''OSes with Implementations'''    | Solaris, OpenSolaris, Nexenta, FreeBSD, Mac OS X, Linux | Linux      | Linux                                           |&
&| '''Stability'''                    | Stable                            | Unstable (On-disk format Stable) | Stable                                          |&
&| '''Stability'''                    | Stable                            | Stable                           | Stable                                          |&
&| '''CLI-System Integration [[1]]''' | Strong                            | Weak                             | Mild                                            |&
(blank line)
'''Features'''
%|                                    | ZFS                               | BtrFS                            | EXT4 and LVM                                    |%
&| '''Grow Online'''                  | Yes                               | Yes                              | Yes                                             |&
&| '''Grow Online'''                  | Yes                               | Yes                              | Only when there are no snapshots                |&
&| '''Shrink Pool'''                  | No                                | Online                           | Online                                          |&
&| '''Shrink Filesystem'''            | No                                | Online                           | Offline                                         |&
&| '''Shrink Filesystem'''            | Online (reduce quota)             | Online                           | Offline                                         |&
&| '''Replace Disk (without parity)'''| Yes (must be compatible size disk)| Yes                              | Yes (copies space allocated on disk)            |&
&| '''Filesystem Level Storage Pooling''' | Yes                           | Yes                              | No                                              |&
&| '''Re-balance'''                   | No                                | Yes                              | Can be done manually (`pvmove`)                 |&
&| '''Checksumming'''                 | Yes                               | Yes                              | No                                              |&
&| '''Autocorrect Checksum Errors'''  | Yes                               | ???                              | No                                              |&
&| '''Compression'''                  | Yes                               | Yes                              | No                                              |&
&| '''De-duplication'''               | Yes                               | No                               | No                                              |&
&| '''De-duplication'''               | Yes (only synchronous)            | Yes (only asynchronous)           | No                                              |&
&| '''Ditto Blocks'''                 | Yes                               | ???                              | No                                              |&
&| '''Tiered Caching'''               | Yes                               | No                               | No                                              |&
&| '''Writable Snapshots'''           | Yes (clone)                       | Yes                              | Yes                                             |&
&| '''Copy-on-Write'''                | Fast, space-efficient             | Fast, space-efficient            | Slow, requires pre-allocating an LV             |&
&| '''Redundancy'''                   | Mirroring and Parity (x1, x2, x3) | Mirroring                        | Mirroring, though the PVs can be RAID devices   |&
(blank line)
'''Limits'''
%|                                    | ZFS                               | BtrFS                            | EXT4 and L V                                    |%
&| '''Maximum Volume Size'''          | 16 Exabytes                       | 16 Exabytes                      | 1 Exabyte                                       |&
&| '''Maximum File Size'''            | 16 Exabytes                       | 16 Exabytes                      | 16 Terabytes                                    |&
&| '''Maximum Number of Snapshots'''  | ''Unlimited''                     | ''Unlimited''                    | Effectively 32                                  |&

[[1]] For lack of a better term -- how well the command line interface integrates with the system as a whole, this might be subjective.

For a more complete, but less focused comparison see [http://en.wikipedia.org/wiki/Comparison_of_file_systems | Wikipedia's Comparison of Filesystems]
----
'''The Rosetta Stone'''


   1. ''Task:'' Create pool of storage from disks `/dev/A`, `/dev/B`, and `/dev/C` (striped or linear concat)
   1. ''Task:'' Create a pool of storage from disks `/dev/A`, `/dev/B`, and `/dev/C` (striped or linear concat)
   11. Using ZFS:
   111. `# zpool create TESTPOOL A B C`
   11. Using BtrFS:
   111. `# mkfs.btrfs /dev/A /dev/B /dev/C`
   111. `# mkfs.btrfs -d raid0 /dev/A /dev/B /dev/C`
   11. Using EXT4 on LVM:
   111. `# pvcreate /dev/A /dev/B /dev/C`
   111. `# vgcreate TESTPOOL /dev/A /dev/B /dev/C`

   1. ''Task:'' Make storage from pool available to system
   11. Using ZFS:
   111. `# zfs set mountpoint=/data TESTPOOL`
   11. Using BtrFS:
   111. `# mkdir /data`
   111. `# mount -t btrfs /dev/A /data`
   111. Update `/etc/fstab`
   11. Using EXT4 on LVM:
   111. `# mkdir /data`
   111. `# lvcreate -L ''SizeOfVolume'' -n DATA TESTPOOL`
   111. `# mkfs -t ext4 /dev/TESTPOOL/DATA`
   111. `# mount /dev/TESTPOOL/DATA /data`
   111. Update `/etc/fstab`

   1. ''Task:'' Replace disk (without parity)
   11. Using ZFS:
   111. `# zfs replace TESTPOOL A D`
   11. Using BtrFS:
   111. `# btrfs device add D /data`
   111. `# btrfs device delete A /data`
   111. `# btrfs filesystem balance /data`
   11. Using EXT4 on LVM:
   111. `# pvcreate /dev/D`
   111. `# vgextend TESTPOOl /dev/D`
   111. `# pvmove TESTPOOL /dev/A /dev/D`
   111. `# vgreduce TESTPOOL /dev/A`
(blank line)
   1. ''Task:'' -->    1. ''Task:'' Add an additional disk to the pool
   11. Using ZFS:
   111. `# zfs add TESTPOOL D`
   11. Using BtrFS:
   111. `# btrfs device add /dev/D /data`
   111. `# btrfs filesystem balance /data`
   11. Using EXT4 on LVM:
   111. `# pvcreate /dev/D`
   111. `# vgextend TESTPOOL /dev/D`
(blank line)
   1. ''Task:'' Add additional space to a filesystem
   11. Using ZFS:
   111. No action needed
   11. Using BtrFS:
   111. No action needed
   11. Using EXT4 on LVM:
   111. `# lvextend -L ''SizeToIncreaseTo'' /dev/TESTPOOL/DATA`
   111. `# resize2fs /dev/TESTPOOL/DATA`
(blank line)
   1. ''Task:'' Remove a disk from the pool
   11. Using ZFS: ''N/A''
   11. Using BtrFS:
   111. `# btrfs device delete /dev/A /data`
   111. `# btrfs filesystem balance /data`
   11. Using EXT4 on LVM:
   111. `# pvmove /dev/A`
   111. `# vgreduce TESTPOOL /dev/A`
(blank line)
   1. ''Task:'' Replace operational disk
   11. Using ZFS:
   111. `# zfs replace TESTPOOL A D`
   11. Using BtrFS:
   111. `# btrfs device add /dev/D /data`
   111. `# btrfs device delete /dev/A /data`
   111. `# btrfs filesystem balance /data`
   11. Using EXT4 on LVM:
   111. `# pvcreate /dev/D`
   111. `# vgextend TESTPOOl /dev/D`
   111. `# pvmove TESTPOOL /dev/A /dev/D`
   111. `# vgreduce TESTPOOL /dev/A`
(blank line)
(blank line)
   1. ''Task:'' Take a snapshot of a filesystem
   11. Using ZFS:
   111. `# zfs snapshot TESTPOOL@snapshot1`
   11. Using BtrFS:
   111. `# btrfs subvolume snapshot /data /data/snapshot1`
   11. Using EXT4 on LVM:
   111. `# lvcreate -s /dev/TESTPOOL/DATA -L ''SizeToAllocate'' -n snapshot1`
(blank line)
   1. ''Task:'' Rollback a snapshot
   11. Using ZFS:
   111. `# zfs rollback TESTPOOL@snapshot1`
   11. Using BtrFS:
   111. ''Not sure...''
   11. Using EXT4 on LVM:
   111. `# lvconvert --merge /dev/TESTPOOL/snapshot1`
(blank line)
   1. ''Task:'' Delete a snapshot
   11. Using ZFS:
   111. `# zfs destroy TESTPOOL@snapshot1`
   11. Using BtrFS:
   111. `# btrfs subvolume delete /data/snapshot1`
   11. Using EXT4 on LVM:
   111. `# lvremove /dev/TESTPOOL/snapshot1`

Legend

     Only in r13
     Only in r25
     -->      Modified slightly between r13 and r25