Bug #36098
lsblk can fail to find PARTLABEL, must fallback to blkid
Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:
0%
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
Specifically, in containers, lsblk can miss the fact that a valid PARTLABEL exists:
[root@osd0 /]# lsblk -P -p -o NAME,PARTLABEL,TYPE /dev/sda1 NAME="/dev/sda1" PARTLABEL="" TYPE="part" [root@osd0 /]# blkid -t PARTLABEL="ceph data" /dev/sdb1: UUID="4a58f041-e07f-4a41-8da5-ef324857f74d" TYPE="xfs" PARTLABEL="ceph data" PARTUUID="edd042e3-4557-40f1-8f97-4a66f47a3994" /dev/sda1: UUID="94f52534-5dd2-465a-aff9-1007d2142b39" TYPE="xfs" PARTLABEL="ceph data" PARTUUID="a472b208-16f8-4732-8ad3-18f9ce4e5a3b" /dev/sdc1: UUID="e332edfe-5cf4-44e7-b0b5-90d469d96aae" TYPE="xfs" PARTLABEL="ceph data" PARTUUID="97a01173-33e4-4ac6-8862-dbc388948b53"
The problem with this is that
simple scanhas this check:
if disk.is_partition(args.osd_path): label = disk.lsblk(args.osd_path)['PARTLABEL'] if 'data' not in label: raise RuntimeError('Device must be the data partition, but got: %s' % label)
Specifically this line:
label = disk.lsblk(args.osd_path)['PARTLABEL']
Should be changed, probably using a helper, that may allow things like:
>>> Device.is_ceph_disk True >>> Device.ceph_disk.journal False >>> Device.ceph_disk.data True
History
#1 Updated by Alfredo Deza over 5 years ago
- Description updated (diff)
- Start date deleted (
09/20/2018)
#2 Updated by Alfredo Deza over 5 years ago
- Status changed from New to Resolved
master PR: https://github.com/ceph/ceph/pull/24330
mimic PR: https://github.com/ceph/ceph/pull/24334
luminous PR: https://github.com/ceph/ceph/pull/24335