[arch-general] [signoff] btrfs-progs

Jackson Alley toomanymirrors at gmail.com
Sun Aug 5 07:40:47 EDT 2012


On 08/05/2012 06:45 AM, Tom Gundersen wrote:
> On Aug 5, 2012 6:04 AM, "C Anthony Risinger" <anthony at xtfx.me> wrote:
>> On Sat, Aug 4, 2012 at 7:53 AM, Jackson Alley <toomanymirrors at gmail.com>
> wrote:
>>> I've rebooted and confirmed the udev rule I found does not resolve the
>>> issue. I don't believe the problem lies with mkinitcpio as I'm not using
>>> a root btrfs system but rather in the init scripts
>>> (
> https://projects.archlinux.org/initscripts.git/commit/?id=13ca7f028ac775773a6685966d0faeee5cc55a9d
> ).
>>> I've attached the boot log and dmesg output.
>>> dmesg: http://pastebin.com/PxfnYgAm
>>> boot log: http://pastebin.com/Pg9xY4u5
>> yeah i didn't think mkinitcpio was involved but you said it was
>> throwing an error about a missing btrfs hook, even though you have no
>> hook defined ... so i asked.
>>
>> AFIAK the FS module is not loaded automatically until mount time --
>> dmesg shows the module being loaded at that time, not when scanned.
>> dracut loads the module just prior to calling `device scan`:
>>
>>
> http://git.kernel.org/?p=boot/dracut/dracut.git;a=blob;f=modules.d/90btrfs/80-btrfs.rules;h=e74f9a6af647e465d9367e95b37aef2e57ddfdbe;hb=HEAD
>> ... and since scanning requires /dev/btrfs-control, which is not
>> created until the btrfs module is loaded, the module MUST be loaded to
>> properly register the device.  i was able to confirm that `btrfs
>> device scan` DOES NOT automatically load the required `btrfs` module.
>>
>> your dmesg shows required devices loading at this time:
>>
>> [    4.058562] sd 9:0:0:0: [sde] 976773168 512-byte logical blocks:
>> (500 GB/465 GiB)
>>
>> ... but the module is not loaded until after all devices fire:
>>
>> [    4.171028] Btrfs loaded
>>
>> ... therefore probably nothing was registered, and thus a few seconds
>> later you see:
>>
>> [    6.081051] btrfs: failed to read the system array on sde1
>>
>> ... try this (tested for one device, unverified for more):
>>
>> # cat /usr/lib/udev/rules.d/70-btrfs.rules
>> ACTION!="remove", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="btrfs",
>> RUN+="/sbin/modprobe btrfs", RUN+="/usr/bin/btrfs device scan
>> $env{DEVNAME}"
> This makes a lot of sense. Please verify.
>
> Tom
Thanks you guys, this worked with slight modification:
$ cat /etc/udev/rules.d/60-btrfs.rules
ACTION!="remove", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="btrfs",
RUN+="/sbin/modprobe btrfs", RUN+="/sbin/btrfs device scan $env{DEVNAME}"

Jackson


More information about the arch-general mailing list