Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|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 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 at 20:56
    
There is also a "rootdelay=3" [seconds] kernel boot option that some people recommend. –  joeforker Jan 10 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.

share|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 at 20:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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