After using Btrfs on both my work and home machines, I’m switching back to ext4. I actually like Btrfs and I wish I could keep using it, but I had two major issues.
The first one and this was enough for me to switch back to ext4, Google Chrome startup time was almost 10 times slower. At first I didn’t realize it was Btrfs causing this, but after some investigation, it’s noticeable how fragmentation affects some applications using Btrfs. I actually switched my work machine to ext4 after I found I could not use the virtual machines I had anymore, because it kept reading the disk for hours at anything I did in the virtual machine (in the end they could not even boot anymore). Btrfs is not always slower, or at least not noticeable, but for a few scenarios that can cause fragmentation, they really do make Btrfs unusable for me.
The second one might just be a misunderstanding of my part, but I read manuals and wikis and could not find an answer. I started with one 150GB partition at work and had another 150GB partition if I wanted to easily switch back to ext4. Then I wanted to test adding multiple devices to Btrfs, which it makes really easy, and added the other partition to the first and did a balance operation, so data was distributed between them. What I did not realize, is that by doing that it created a RAID 1 with my partitions. As far as I know, RAID 1 with two partitions in the same drive are just useless, it just duplicates data between both partitions. After reading more manuals, I learned that on creation time you can control the RAID level, but I found no way to do it afterwards. And the worst of it, I found no way to degrade back to RAID 0, so I found no way to remove the second partition from the filesystem, which means I ended up with 300GB of space being used as 150GB.
And another issue I had, it was not always obvious how much disk space I had free. In some places it indicated 300GB, others 150GB. And in my home machine I even had an out of free space error when it indicated I had 6GB free.
Despite its powerful features, I could not justify the problems I had. Actually, I was not using snapshots and sobvolumes as much as I expected. I believe this may change as more tools are written to take advantage of these features.
I knew well before I started using it that it’s not production ready or even finished yet. Btrfs is definitely a step in the right direction and I hope I can try using it again in some time. It even managed not to lose any of my data despite me poking with stuff I did not understand.
Yeah, it’s not the most friendly filesystem to work with yet, but it has some pretty cool stuff.
Right now, I have Ubuntu 10.10 installed on btrfs, and, in a sub-volume/snapshot, I’ve upgraded to 11.04. According to df, I only have 6GB used on /; `btrfs filesystem df /` says ‘total=8.00GB, used=5.64GB’., either way, I have two versions of Ubuntu installed in less than 8GB of space.
What I’m really waiting for is a way to access sub-volumes as if they were physical devices, so I could use them in more advanced ways (for instance, `dd if=/some/file.img of=/dev/disk/by-path/pci-bla-part3-subvol2`). Then, I could use one sub-volume as an installation medium, and another as the install target. And, of course, there are all sorts of other cool stuff when you have direct access to the sub-volume (one obvious benefit would be not having to use a subvolid option to mount the sub-volume).
I’m kind of disappointed by sobvolumes. Upgrading to 11.04 within a snapshot is really cool, but I found kind of difficult to work with subvolumes to hold different OSes.
For instance, I wanted Arch Linux in a sobvolume, Ubuntu in another and my Home partition in another, which means I would have the advantages of separate partitions without wasting space. However I found doing so is kind of risky and difficult.
Accessing them as physical devices might help, but I don’t know how they would do that. I think we do need better ways to access subvolumes (hate them being folders, hate even more that they are not always treated as folders, try copying files from a root directory to a sobvolume, data is copied byte by byte).
You could create an empty sub-volume, set it as the default, and install without formatting the partition (if the distribution supports btrfs on the install media); it’s not ideal, but it works.
What’s nice is you can move the folders as regular folders, so what I did was create a btr_subvolumes folder at /, and mv’d all my sub-volumes into that folder. Unfortunately, it only exists on the “master” (or whatever it’s called) sub-volume (0), but at least you don’t have to worry about folder name conflicts or cluttering the root filesystem.
Haven’t tried copying files between sub-volumes; haven’t really had a need, yet. Shouldn’t it just need to change some metadata or something to do that?
All COW-based filesystems fragment a lot by design, so I don’t think it will be fixed, defragmenting the filesystem (command “btrfs filesystem defrag”) will be always neccesary. There is a option to disable COW’ing of data (nodatacow) that IMO it has a lot of sense.
By creating RAID1 across partitions on the same device, you’ve manually (and comprehensively) fragmented your data. Since RAID1 isn’t something you intended or wanted, switching back might be a good start to overcoming this problem. Usually you can simply remove a partition from RAID, and as part of that operation, the data should be migrated to other partitions, but DO verify that this can be done with btrfs before proceeding. The docs here:
https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices
say, “btrfs device remove is used to remove devices online. It redistributes the any extents in use on the device being removed to the other devices in the filesystem.”
The 6GB free when claimed to be full sounds like a reserved block issue. The 150GB vs. 300GB sounds more serious, but might be just how btrfs presents volumes and/or subvolumes when asked about them in particular ways.
datacow is known to break db performance. Don’t use it with databases. This includes the database of your browser, too. Use it for file partitions only (like your music/photo/movie collection).
Virtual machine performance is bad due the implementation of O_SYNC, which kvm uses by default. Disable O_SYNC on kvm and your back to normal.
0 Pingbacks