I am using btrfs with bcache for / on Ubuntu 13.10. It's fast. Unfortunately, during normal boots the step "Scanning for btrfs filesystems" fails. To successfully boot I have to enter recovery mode and then simply choose the menu option "continue to the main system".

I assume a normal boot fails because the bcache0 device has not finished being created by the time btrfs scans for its filesystems. How can I insert a delay between these steps?


Btrfs is actually supposed to react to new devices dynamically, through udev calling btrfs device ready/BTRFS_IOC_DEVICE_READY. See /lib/udev/rules.d/64-btrfs.rules. This logic obsoletes btrfs device scan which is inappropriate for a dynamic boot. According to this, Btrfs' messages to udev have a flag to tell when there's enough backing devices to mount the Btrfs filesystem on them.

However, I'm not sure that mountall (an underdocumented piece of software that scans /etc/fstab and calls mount) implements the rest. The solution involves either fixing mountall or hacking up something that could be specific to your system, putting the mount command in /etc/rc.local or a custom udev rule.

| improve this answer | |
  • I don't actually have to do anything in recovery mode however. I just choose the first option "continue". I don't know whether it runs "mountall" as a side-effect. – joeforker Jan 8 '14 at 19:43
  • It probably works because the recovery boot delays mountall. That's another possible workaround; add a sleep 1 to /etc/init/mountall.conf. Apparently you can also add a --debug in there. – Gabriel Jan 8 '14 at 20:56
  • There is also a "rootdelay=3" [seconds] kernel boot option that some people recommend. – joeforker Jan 10 '14 at 14:11

Btrfs is not currently stable with bcache (Feb 2014) - this is a known bug and being worked on, but for the moment I'd strongly advise against this use.

| improve this answer | |
  • Yes, it was fast, but I got tired of reformatting. On the plus side the newly-created btrfs filesystem seems to work better in general than the years-old one. – joeforker Feb 12 '14 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.