Boot halted by btrfs issue

So I decided to try BTRFS. Overall it works really well. I’ve got two hard drives set up in a mirrored mode:


sudo /sbin/btrfs filesystem show
Label: none  uuid: 5d0d8aa5-b729-4ddd-92f5-5243726cdcc4
        Total devices 2 FS bytes used 184.38GiB
        devid    1 size 232.88GiB used 232.88GiB path /dev/sdb1
        devid    2 size 232.88GiB used 232.87GiB path /dev/sdc1

The problem:
During boot, I get dropped into superuser mode and to continue boot I need to rescan the devices with

btrfs device scan

Here’s the btrfs log in /var/log/messages


sudo cat /var/log/messages|grep btrfs
Jul 31 10:52:49 kisa kernel:    24.759276] btrfs: device fsid 5d0d8aa5-b729-4ddd-92f5-5243726cdcc4 devid 1 transid 206589 /dev/sdb1
Jul 31 10:52:49 kisa kernel:    24.759489] btrfs: use lzo compression
Jul 31 10:52:49 kisa kernel:    24.759491] btrfs: disk space caching is enabled
Jul 31 10:52:49 kisa kernel:    24.759752] btrfs: failed to read the system array on sdb1
Jul 31 10:52:49 kisa kernel:    24.759897] btrfs: open_ctree failed
Jul 31 10:52:49 kisa kernel:    43.665147] btrfs: device fsid 5d0d8aa5-b729-4ddd-92f5-5243726cdcc4 devid 1 transid 206589 /dev/sdb1
Jul 31 10:52:49 kisa kernel:    43.665803] btrfs: device fsid 5d0d8aa5-b729-4ddd-92f5-5243726cdcc4 devid 2 transid 206589 /dev/sdc1
Jul 31 10:52:49 kisa kernel:    45.665241] btrfs: device fsid 5d0d8aa5-b729-4ddd-92f5-5243726cdcc4 devid 1 transid 206589 /dev/sdb1
Jul 31 10:52:49 kisa kernel:    45.665619] btrfs: use lzo compression
Jul 31 10:52:49 kisa kernel:    45.665621] btrfs: disk space caching is enabled

Let me know if any other logs will be helpful or if anyone experienced or discovered a fix for this issue.
Thank you.

Since no one replied I thought I’d add more info:

Since I thought boot is failing because btrfs needs to scan for devices before it can mount a multiple devices, I added the following line to boot.localfs:

/sbin/btrfs device scan

But the boot process still halts.

Then I noticed that the boot is actually interrupted by the following error:

FATAL: Module btrfs not found.

But the module is obviously there and lsmod confirms it along with the fact that I can boot successfully after running

btrfs device scan

Does anyone have any ideas? I can’t be the only person trying BTRFS raid setup.

This error means that the module in not in initrd, which you can check with this command:

# lsinitrd /boot/initrd | grep 'btrfs.ko'

Yes, because in gets loaded later from the file system. If you want to include this module in your initial ramdisk, use:

YaST → /etc/sysconfig/Editor → System → Kernel → INITRD_MODULES and add ‘btrfs’ to the list.

OK, save and reboot.

It will make this error go away. I’m not sure it will solve your problem though, as I’m not using btrfs.

If you do this command again after reboot:

# lsinitrd /boot/initrd | grep 'btrfs.ko'

you should see the btrfs module listed in your ramdisk.

But if you do (now and before adding the module) :

# lsinitrd /boot/initrd | grep btrfs

you will see that initrd contains a bunch of btrfs utilities but not the module (until you added it yourself). Sounds like a bug, I would say.

On 08/22/2012 01:46 AM, daq wrote:
> Does anyone have any ideas? I can’t be the only person trying BTRFS
> raid setup.

hmmmm…last i heard: while the file system was getting pretty stable
the the common tools (like fsck, etc) remain wanting…

or, has that changed?

anyway, since i don’t have a sandbox machine i’ve avoided testing
btrfs with my real data at risk…

i suppose you protect your data with a bulletproof backup system to a
non-btr file system? (which your RAID is not, right?)


dd

That was it. Thank you very much.

Its amazing that there’s at least 2 tickets open in bugzilla about this issue with no solutions and suse devels pointing the finger @ btrfs devels.

I’ll leave comments there as well.

I am running opensuse 12.1 with all updates - using XEN and 10 VMs and EXT4 filesystems only. Since 3 weeks system halts or crashes unexpected by accident. I definitely have no btrfs. But console screen shows:
FATAL: Module btrfs not found.
Trying manual resume from …
So I followed the hints from above, adding acpi=off and loading btrfs, ok, it boots slowly
I didnt find any hint in the logs
but now I am frightening by acident crashes at any time day and night.

what happend with that dammned btrfs driver, which I do not use and do not need ?

I did read, that the btrfs driver is unstable and other distributiions dod cancel that project, but I dont use it - or do I ?

Does anybody find the trick or the bug ?

If you don’t have btrfs, then ignore this error.

I don’t know if it is related but obvioulsy, you should remove btrfs from iNITRD_MODULES. What do you want do tho with this driver anyway?

Why would it complain about BTRFS module if it wasn’t needed? Are you sure you’re not using it? Paste your /etc/fstab here.

Because initrd contains a boot script which loads this module and the module is not included (until you add it yourself).

**# lsinitrd /boot/initrd | grep 'boot/' | sort -n**
boot/01-acpi.sh
boot/01-devfunctions.sh
boot/02-start.sh
boot/03-rtc.sh
boot/03-storage.sh
boot/04-udev.sh
boot/05-clock.sh
boot/06-blogd.sh
boot/11-block.sh
boot/11-usb.sh
boot/21-devinit_done.sh
boot/81-btrfs.sh
boot/81-resume.userspace.sh
boot/82-resume.kernel.sh
boot/83-mount.sh
boot/84-remount.sh
boot/91-createfb.sh
boot/91-killblogd.sh
boot/91-killudev.sh
boot/91-mtab.sh
boot/91-shell.sh
boot/92-killblogd2.sh
boot/93-boot.sh

I think here’s the instruction which causes the error:

**$ cat /tmp/boot/81-btrfs.sh**
#!/bin/bash -e
#%stage: filesystem
#%if: -x /sbin/btrfs
#%programs: /sbin/btrfs /sbin/btrfs-zero-log /sbin/btrfs-convert /sbin/btrfs-select-super /sbin/btrfs-image /sbin/btrfstune /sbin/btrfs-restore /sbin/btrfs-find-root /sbin/btrfsck /sbin/mkfs.btrfs /sbin/btrfs-dump-super /sbin/btrfs-debug-tree

**modprobe btrfs**

if  -x /sbin/btrfs ]; then
        /sbin/btrfs dev scan >& /dev/null
fi

This script is executed before 83-mount.sh. Thus the driver can not be loaded from the root file system. It has to be in the initial ramdisk, but it is not.

On 08/30/2012 12:06 PM, daq wrote:
>
> rdeipw2;2482609 Wrote:
>> I am running opensuse 12.1 with all updates - using XEN and 10 VMs and
>> EXT4 filesystems only. Since 3 weeks system halts or crashes unexpected
>> by accident. I definitely have no btrfs. But console screen shows:
>> FATAL: Module btrfs not found.
>>
>
> Why would it complain about BTRFS module if it wasn’t needed? Are you
> sure you’re not using it? Paste your /etc/fstab here.

The reason it needs it is likely because it is in MODULES_LOADED_ON_BOOT. That
forces it to load even if there are no btrfs file systems; however, the error
can be ignored.