btrfs is included in Oracle Linux, currently heavy work is being done to make this into a production supportable filesystem and make sure it's going through a huge amount of filesystem testing, recovery scenarios, performance etc.
- checksumming of data and metadata (CRC)
- built-in device/space management (spanned across devices) (so multiple device support no need for lvm)
- support for raid0, raid1, raid10 and single at this point (with raid5/6 in the works)
- ability to independently span metadata and data across these devices
- copy on write(COW) for both data and metadata
- writable snapshots
- create filesystem in existing btrfs pool without need to worry about device management
- online resize of filesystem (both grow and shrink)
- transparent compression, you can even specify for each file, or across all (lzo or zlib)
- ability to defrag files and/or directories
- balance command to balance filesystem chunks in a path across multiple devices if needed
- online add and remove devices to/from filesystems
- support for trim and SSD optimizations
- in place conversion from ext3/4 to btrfs
- file-based or object based cloning support with reflink (per file clone)
- file allocation is extent based with B-tree directory structures
- cool feature for cloning is that you can use filesystem seeding on read-only storage to then have a COW btrfs fs)
- for the little details :
Max file size 16 EiB
Max number of files 2^64
Max volume size 16 EiB
Getting started is very easy. btrfs.ko is the kernel module that needs to be loaded and btrfs-progs is the package that has all the needed utilities to get started.
Oracle Linx and RHEL
Add 3 8gb devices to my system, per /proc/partitions output : /dev/sdb, /dev/sdc, /dev/sdd.
So let's create a btrfs filesystem on those 3 devices and label it btrfstest. I will also use -d raid10 and -m raid10 to show how easy it is to decide your spanning choices for both.# mkfs.btrfs -L btrfstest -d raid10 -m raid10 /dev/sdb /dev/sdc /dev/sdd
create a mountpoint /btrfs and mount the filesystem root there :
as you can see, we now have a filesystem mounted that shows the diskspace of the 3 disks we added. btrfs filesystem show gives more detailed information including the device list and use:
Now to quickly show how easy it is to remove/add a device to an existing, mounted volume:
lets remove /dev/sdc
as you can see, it now shows 8GB less of space available. so, let's add it back in:
and it's back!
on to snapshots. I created a few files in /btrfs and now want to create a snapshot. so while using sync I will first sync the fs and then create a snapshot under /btrfs/.snapshot:
and creating a new subvolume (a new possible mountpoint without any files, so not a snapshot just a mknewfs really)
Some random commands to play with : 1) filesystem df shows a more detailed explanation of what's going on.
2) list subvolumes:
3) if your filesystem is unbalanced due to tons of file creates and possible add/remove of devices you can rebalance it online:
4) use cp to clone files on btrfs with COW (so individual file clones not just volumes):
5) deferagment filesystem:
There you go. A quick 5 minute overview of some of the nifty stuff this FS can do and you have full access to. A lot more is coming and I will make sure to showcase new features as we make them available. Use this to have a backup root filesystem for recovery purposes, to do updates of rpms and the ability to fall back to a good previous known state. Use it for virtual machine files and the power of reflink. So many possibilities and virtually no filesystem or volume limits.