Bug 1320340 - blivet: fix btrfs label and mkfsoption handling
Summary: blivet: fix btrfs label and mkfsoption handling
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-blivet
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Blivet Maintenance Team
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-22 22:22 UTC by Bryan Wann
Modified: 2021-09-03 14:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-15 07:40:38 UTC
Target Upstream Version:


Attachments (Terms of Use)
Patch for btrfs handling in blivet (3.22 KB, text/plain)
2016-03-22 22:22 UTC, Bryan Wann
no flags Details
Anaconda / blivet traceback from btrfs (208.51 KB, text/plain)
2016-03-22 22:23 UTC, Bryan Wann
no flags Details

Description Bryan Wann 2016-03-22 22:22:55 UTC
Created attachment 1139248 [details]
Patch for btrfs handling in blivet

Description of problem:
When kickstart installing a 7.2 system with a btrfs root partition, Anaconda raises a traceback from blivet with this error:

ValueError: / is not a valid name for this device


Version-Release number of selected component (if applicable):
blivet 0.61.15.37
anaconda 21.48.22.56-1
CentOS 7.2


How reproducible:
Reproducible on every kickstart install with btrfs on root partitioning


Steps to Reproduce:
1. Kickstart install a host with this partitioning scheme:

zerombr

clearpart --all --drives=sda --initlabel
bootloader --location=mbr --append="crashkernel=128M console=tty0 console=ttyS1,57600 pcie_pme=nomsi"
part /boot/efi --label=/boot/efi --fstype efi --size=256 --ondisk=sda
part /boot --label=/boot --fstype ext3 --size=512 --ondisk=sda
part swap --size=2048 --ondisk=sda
part btrfs.01 --size=1 --grow --ondisk=sda
btrfs / --label=/ --mkfsoptions="-l 32K -n 32K" btrfs.01
ignoredisk --only-use=sda

2.
3.

Actual results:
Anaconda starts, attempts to partition disks, throws traceback (see attached anaconda-tb-btrfs) for full stacktrace

anaconda 21.48.22.56-1 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.7/site-packages/blivet/devices/device.py", line 84, in __init__
    raise ValueError("%s is not a valid name for this device" % name)
[...cut...]
ValueError: / is not a valid name for this device

Expected results:

Anaconda succeeds in installing the system, has a working brtfs / when it boots:

[root@sparefullweb20650 ~]# btrfs filesystem show
Label: '/'  uuid: 423aebd5-3c9f-406f-9655-51d44ba3763e
        Total devices 1 FS bytes used 2.32GiB
        devid    1 size 463.01GiB used 5.04GiB path /dev/sda4

Btrfs v3.16.2



Additional info:

Chris Mason authored a patch for blivet that corrects this problem (btrfs-kickstart.diff), I'm submitting it on his behalf. We have been using this in production at Facebook and it seems to do the trick.

His notes from the patch:

======
blivet: fix btrfs label and mkfsoption handling

The btrfs volume class didn't have an override in place for isNameValid(),
so it wasn't able to accept labels with / in them.

Also, the mkfsoptions= arg wasn't being passed all the way down to mkfs.btrfs
======

Comment 1 Bryan Wann 2016-03-22 22:23:42 UTC
Created attachment 1139249 [details]
Anaconda / blivet traceback from btrfs

Comment 3 David Lehman 2016-04-25 18:11:32 UTC
Note: This should be fixed in python-blivet-0.76-1 (commit c0933675).

Comment 5 RHEL Program Management 2020-12-15 07:40:38 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.