openSUSE 12.2, there is an important choice to be made when updating: to stay with the ext4 file system or make the leap ahead with the btrfs file system. While ext4 was a rather minor upgrade of ext3, which in its turn was an upgrade of ext2, btrfs is an entirely new file system. It was originally proposed in 2007 and offers a lot of new features. It is based on B-trees and offers copy-on-write.
Although btrfs is approximately five years old, it is still considered experimental. So why would one choose it as primary file system? Let us read the FAQ on the btrfs website:
Is btrfs stable?Short answer: No, it's still considered experimental.
Long answer: Nobody is going to magically stick a label on the btrfs code and say "yes, this is now stable and bug-free". Different people have different concepts of stability: a home user who wants to keep their ripped CDs on it will have a different requirement for stability than a large financial institution running their trading system on it. If you are concerned about stability in commercial production use, you should test btrfs on a testbed system under production workloads to see if it will do what you want of it. In any case, you should join the mailing list (and hang out in IRC) and read through problem reports and follow them to their conclusion to give yourself a good idea of the types of issues that come up, and the degree to which they can be dealt with. Whatever you do, we recommend keeping good, tested, off-system (and off-site) backups.
Pragmatic, personal and anecdotal answer: (HugoMills, 2011-08-21) In the last few months, the vast majority of the problems with broken and unmountable file systems I've seen on IRC and the mailing list have been caused by power outages in the middle of a write to the FS, and have been trivially fixable. We also have more filesystem-fixing tools coming along soon, which may make you happier about stability.
This does not sound too bad and after five years of development, it should be fairly stable. This was also what I read on the Internet, so, in the last couple of weeks, I decided to give btrfs a try in a virtual machine running openSUSE 12.2 release candidates. Installation went smoothly and afterwards I ran some tests, creating and deleting subvolumes, reverting an update with snapper, etc. I also shut down the virtual machine abruptly several times, simulating power failures, while writing data. Whatever I tried, the file system remained stable. Even when it would go wrong, there is now a file system check too, btrfsck, that can detect and fix some errors and a recovery tool to retrieve data from a damaged btrfs file system.
Besides that, you have to keep good backups anyway, Even when you have the most stable file system, hard drives can fail, users can accidentally destroy data, etc.
I searched the net for forums, websites, bug reports for more information. This is the overview of my findings:
- Subvolumes and snapshotting
- More stable backups: you can take a snapshot and backup that. Even when users work while the backup software is running, the backup will end up in a consistent state.
- Incremental backups using e.g. rsync and snapshotting.
- Rollback to an older version is easy and fast, especially in openSUSE with the snapper tool. Ideal for testing newer versions of software and going back when there are issues.
- Checksumming of data and metadata
- The last one is considered important as a measure against file system corruption to the extend hat it was also implemented for ext4 in kernel 3.5
- Multiple device support
- File Striping, File Mirroring, and File Striping+Mirroring implementations
- Prepared for performance
- Online defragmentation
- SSD awareness, discard support and several optimizations
- As mentioned already, still marked experimental in the Linux kernel
- Although the interfaces and file system format are said to be stable, there will still be many changes under the hood.
- Quota support will only arrive with Linux 3.6 and has to be tested then
- For Linux 3.4, Phoronix concludes that for most workloads ext4 remains well ahead of btrfs.
- So while the developers have thought of performance, it is still not completely there yet.
Do you have any experience with btrfs or comments you would like to share? Please let me know!