Btrfs in Fedora 13
Interview with Josef Bacik
So, i guess you could start by telling us a little bit about yourself
Sure thing. I've worked for Red Hat for almost 6 years now. Originally I was an intern in our support organization, and eventually I ended up in the filesystem kernel group a few years ago. When Chris Mason announced Btrfs in 2007 (I think) I started poking around on it, mostly trying to do little things to make it more feature complete. Before that most of my filesystem experience was with GFS/GFS2, our clustered filesystem. So moving to a non-clustered fs was quite a nice change. Ever since then I've devoted probably 1/2-3/4 of my work time to Btrfs.
What is Btrfs exactly?
It is a new filesystem thats trying to bring in some more modern features to Linux. For example, it has snapshotting and subvolume support built into the filesystem, instead of having to rely on another layer, such as LVM, to give you those features. It has some unique data integrity features, such as checksumming for all data and metadata and we use a method call copy-on-write to deal with general data integrity, instead of the traditional journaling filesystems like Ext4 and Xfs.
And to break it down a bit for those non computer scientists out there...
Snapshotting means that you can create an exact copy of the volume at a given point in time. This is useful for backup programs that don't want to have to deal with a changing filesystem. You can take a snapshot of the filesystem, and then backup from the snapshot. For Fedora we've used this feature to give us extra safety when doing yum transactions. So right before doing a big yum update, our plugin will take a snapshot of the filesystem, now you have two copies of the filesystem, and then yum does its update onto your original volume. Then if something goes horribly wrong, you can "rollback" to the snapshot that was taken before you did the yum update. You do this by making the snapshot the default volume to be mounted, so next time you reboot your system will be just like it was before you ran a yum update. Then you can mount the broken volume somewhere else and try and fix things manually
Subvolumes are just a different way to organize your data. Because Btrfs has built in RAID, the idea is that in the future you will be able to assign different RAID profiles to different subvolumes.
What is RAID?
RAID is a way to organize data across several disks and there are different levels. So RAID0 is called striping, that does basically what LVM does, takes 2 disks and makes them look like 1 big disk. And RAID1, which is called mirroring, will take 2 disks and copy the data between the two of them and make it look like 1 disk. For example if you have 2 disks, and you don't really care about your OS, but you really want your /home directory to be mirrored in case one disk fails, you can create a subvolume for / and use just the normal data profile, and then create a /home directory and set its data profile to be RAID1. Then anything you write to /home will be copied between the two disks. So if one of your hard drives dies you can recover all of your /home data from the other drive
More information on RAID at []
Are snapshots and RAID components/features of Btrfs?
Yes, Btrfs has a bunch of volume management type features along with being a normal filesystem. I don't think I said this explicitly, but Btrfs can deal with having multiple disks within itself instead of having to use MD or LVM, which is what lets us do things like RAID1 and such.
What do MD and LVM stand for?
LVM stands for logical volume management, the default install of Fedora puts everything in a LVM volume group. I'm not entirely sure what MD stands for, but its what gives Linux Software RAID.
So Btrfs is not the default for Fedora 13?
Oh no, its not ready for primetime yet. It's still very much an experimental fs that is under heavy development. A lot of the key features are there, but a lot of stabilizing and such needs to be done still
Fedora 13 users can opt to use it? (and probably work on it?)
Yes, if you give the installer the "btrfs" option on boot it will allow you to install onto a Btrfs fs. It's been an option since Fedora 11. The box I'm currently working on is Fedora 11 with a Btrfs root. Of course it is much faster and much more stable in Fedora 13.
If the installer boot's with Btrfs, how do they use Btrfs? Is it automatic?
You just select a custom disk layout instead of the default one, and then when you setup your volumes you tell it to format the volume as Btrfs instead of Ext4. You still need to have a separate /boot partition that needs to be formatted as ext3 since Fedora 13's grub doesn't have Btrfs support yet.
Details about how to use Btrfs for those that choose to use Btrfs
You get a /dev/sda1 and a /dev/sda2 (or whatever). The first partition is around 250 megabytes, and gets formatted as Ext3 and given the mountpoint of /boot. Then usually /dev/sda2 is made into a volumegroup and there are different logical volumes added to that which are formatted as Ext4. Instead of doing that you want to have your first partition be formatted as Ext3 and have the mountpoint of /boot just like normal and then you can change your / logical volume to have a fs type of Btrfs instead of Ext4.
If you use the normal layout option in anaconda, I usually create a /dev/sda1 for /boot, a /dev/sda2 for swap, and then a /dev/sda3 for / which is formatted as Btrfs.
Well our default layout makes 2 partitions, one that is used for /boot, and one that is used for LVM. Within that volumegroup you generally have 2 volumes, one for swap, and one for / that is formatted as Ext4. If you want the easiest way of changing it you can tell it to just give you the default layout, and then choose to review the layout before creating it. Then when it takes you to the review screen you can change the logical volume that is formatted as Ext4 to be formatted as Btrfs.
More details on use...
So when you first see the installer screen when booting up an install disk just hit tab and you will have a boot prompt. Type in linux Btrfs and hit enter and you will have the option of formatting your volume with Btrfs.
As for Fedora 13, if you install on Btrfs and want to use the rollback feature you'll want to install the yum plugin for it. But you'll want to keep in mind that the plugin will create a snapshot *every* time you do a yum action, so you will get a lot of /yum-<date> snapshots building up in your / directory. (That means you should delete every once and a while to prevent space being needlessly wasted.)
The plugin is yum-plugin-fs-snapshot and that plugin is in the normal repos. So you can just do yum install yum-plugin-fs-snapshot and it will start working automatically.
Are there any screenshots/tutorials for users?
I don't think there are any tutorials yet. Since Btrfs is still experimental, we want to try and make sure that only people who know the risks are able to use it. Though I think at this point it may be a good thing to put together.
Btrfs is not ready for widespread release yet. Is there a timeline for the project?
Nope it's not ready yet. For one thing there is no working fsck, so if something goes wrong the only way to fix your filesystem is to reformat and restore from backups. My own personal goal is to have the special "btrfs" anaconda option taken away by Fedora 15, so that anybody can choose to use it. And then hopefully have everything stable enough to be the default in Fedora 16 or 17. So hopefully fall of next year it will be stable enough for it to be the default Fedora filesystem. I want to take the anaconda away so that any user can just use Btrfs if they choose without having to give the installer a special option.
Is there anything else you think is important for people to know about Btrfs?
Just to keep in mind that it is a new filesystem that is constantly changing, so if you are going to use it with data you care about you need to make sure to back up regularly.
Well, thanks again. Sounds good, thanks for doing this. Glad to help and thank you.
Full interview can be found here. []
How many developers are working on Btrfs full time from Red Hat? What do they focus on?
Just me. I focus on anything and everything that needs to be done. The other two full time developers are from Oracle.
How good is that Ext3/Ext4 in place conversion?
It's perfect, flawless, bugfree. We use e2fsprogs to actually read the ext* metadata, and then store the original ext* fs in a special snapshot, so if you don't like the conversion you can just bring the old filesystem back.
Are there any good benchmarks available for performance?
Yup the most complete set of benchmarks that are being run on a regular basis can be found here []
What does the roadmap look like and are there any major pending features or is it all just bug fixes and stabilization work going forward?
Well there's not really a roadmap per-se, but there is a TODO on the BTRFS wiki []
But the target keeps moving. My own personal roadmap is
- direct io support
- different RAID types per subvolumes
- performance and stabilization
But for the most part BTRFS is feature complete enough to be used on a daily basis, so we try and work on bugs as they pop up, and then work on these overarching features when we have time.
Are there any features that ZFS has that Btrfs does not at this point?
ZFS can do data deduplication which isn't done for BTRFS, but is planned to be done at some point. Other than that I think we do pretty much everything they do, but then again I don't know a whole lot about ZFS.
Chris Ball, email@example.com Josef Bacik, firstname.lastname@example.org
The Features/SystemRollbackWithBtrfs wiki page has more information []