Bug 984516 - extending btrfs causes boot failure
extending btrfs causes boot failure
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem
Current
Other Other
: P5 - None : Major (vote)
: ---
Assigned To: systemd maintainers
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-13 18:28 UTC by Markus Koßmann
Modified: 2016-09-22 09:23 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
output of journalctl -b (86.33 KB, text/x-vhdl)
2016-06-13 18:28 UTC, Markus Koßmann
Details
output of udevadm info --export-db (184.43 KB, text/plain)
2016-06-13 18:30 UTC, Markus Koßmann
Details
rdsosreport.txt (113.03 KB, text/plain)
2016-06-13 18:31 UTC, Markus Koßmann
Details
rdsosreport.txt with updated initrd (113.40 KB, text/plain)
2016-06-16 17:50 UTC, Markus Koßmann
Details
output of udevadm info --export-db withupdated initrd (186.02 KB, text/plain)
2016-06-16 17:52 UTC, Markus Koßmann
Details
output of journalctl -b with updated initrd (86.75 KB, text/x-vhdl)
2016-06-16 17:54 UTC, Markus Koßmann
Details
Upstream btrfs rules (418 bytes, text/plain)
2016-06-16 18:11 UTC, Andrei Borzenkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Koßmann 2016-06-13 18:28:58 UTC
Created attachment 680656 [details]
output of journalctl -b

root on btrfs on lvm (  # btrfs filesystem show

Label: none  uuid: a4a69c17-1731-4c09-a940-83fdfb8ac4d7
        Total devices 1 FS bytes used 17.17GiB
        devid    1 size 40.00GiB used 21.29GiB path /dev/mapper/system--nvme-root_factory )

Trying to extend  that with another lvm partition with 
 btrfs device add /dev/system-nvme/root_extent /
results in :
  
# btrfs filesystem show
Label: none  uuid: a4a69c17-1731-4c09-a940-83fdfb8ac4d7
        Total devices 2 FS bytes used 17.17GiB
        devid    1 size 40.00GiB used 21.29GiB path /dev/mapper/system--nvme-root_factory
        devid    2 size 20.00GiB used 0.00B path /dev/mapper/system--nvme-root_extent

Now rebooting the system fails with 
BTRFS: failed to read chunktree on dm0
BTRFS: open ctree failed. 
and dropping me into a initrd shell
Undoing the extension with btrfs device delete from another opensuse installation makes the system booting again

I'll attach the output of journalctl -b, udevadm info --export-db and rdsosreport.txt

There was allready some discussion about a similar bug with 13.2 on https://forums.opensuse.org/showthread.php/518220-fun-with-extending-btrfs
Comment 1 Markus Koßmann 2016-06-13 18:30:35 UTC
Created attachment 680657 [details]
output of udevadm info --export-db
Comment 2 Markus Koßmann 2016-06-13 18:31:17 UTC
Created attachment 680658 [details]
rdsosreport.txt
Comment 3 Andrei Borzenkov 2016-06-14 03:24:09 UTC
(In reply to Markus Koßmann from comment #0)
> # btrfs filesystem show
> Label: none  uuid: a4a69c17-1731-4c09-a940-83fdfb8ac4d7
>         Total devices 2 FS bytes used 17.17GiB
>         devid    1 size 40.00GiB used 21.29GiB path
> /dev/mapper/system--nvme-root_factory
>         devid    2 size 20.00GiB used 0.00B path
> /dev/mapper/system--nvme-root_extent
> 
> Now rebooting the system fails with 
> BTRFS: failed to read chunktree on dm0
> BTRFS: open ctree failed. 
> and dropping me into a initrd shell

dracut configuration includes only system--nvme-root:

+ cat /etc/cmdline.d/90lvm.conf
 rd.lvm.lv=system-nvme/root_factory 
 rd.lvm.lv=system-hd/swap 

Did you rebuild initrd after adding device to btrfs?
Comment 4 Markus Koßmann 2016-06-16 17:50:35 UTC
Created attachment 681075 [details]
rdsosreport.txt with updated initrd
Comment 5 Markus Koßmann 2016-06-16 17:52:42 UTC
Created attachment 681076 [details]
output of udevadm info --export-db withupdated initrd
Comment 6 Markus Koßmann 2016-06-16 17:54:12 UTC
Created attachment 681077 [details]
output of journalctl -b with updated initrd
Comment 7 Andrei Borzenkov 2016-06-16 18:11:09 UTC
Thanks. What happens here is that rules in 64-btrfs.rules do not work at all, so systemd attempts to mount root as soon as the first device appears. Please, replace /usr/lib/udev/rules.d/64-btrfs.rules with attached file, rebuild initrd and test again. If you still observe this issue, please boot with rd.udev.debug and "quiet" removed from kernel command line and attach "journalctl -b" output.
Comment 8 Andrei Borzenkov 2016-06-16 18:11:55 UTC
Created attachment 681078 [details]
Upstream btrfs rules
Comment 9 Markus Koßmann 2016-06-17 15:09:41 UTC
Upstream btrfs rules seem to fix the problem.
Comment 10 Andrei Borzenkov 2016-06-18 17:08:41 UTC
Thanks, I was actually a bit surprised it worked :) but I see now that mkinitrd also calls update-bootloader --refresh which explains why it was enough.

Anyway, reassigning to systemd now and submitted SR to fix rules for devel project:

SR#403388

@systemd-maintainers: I think we need update for all versions affected by boo#912170 as well.
Comment 11 Thomas Blume 2016-06-24 15:37:16 UTC
(In reply to Andrei Borzenkov from comment #10)
> @systemd-maintainers: I think we need update for all versions affected by
> boo#912170 as well.

Thanks for the info.
I have submitted a request for the v210 versions.
Comment 12 Franck Bui 2016-09-22 08:35:49 UTC
I'm closing this bug since it should be fixed in TW.

See bsc#912170 which is about openSUSE distros.
Comment 13 Franck Bui 2016-09-22 09:23:14 UTC
(In reply to Franck Bui from comment #12)
> I'm closing this bug since it should be fixed in TW.
> 
> See bsc#912170 which is about openSUSE distros.

I meant: "which is about *other* openSUSE distros".