Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1647549

Summary: raid volume phy devices - should 'lvs -o devices' not show all phy devices?
Product: Red Hat Enterprise Linux 7 Reporter: lejeczek <peljasz>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Displaying and Reporting QA Contact: cluster-qe <cluster-qe>
Status: CLOSED NOTABUG Docs Contact:
Severity: high    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 7.5   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-15 19:11:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description lejeczek 2018-11-07 18:05:02 UTC
Description of problem:

$ lvs -a -o devices 5tb.Toshiba-Lot/raid0
  Devices                                            
  /dev/sdar(0),/dev/sdas(0),/dev/sdat(0),/dev/sdau(0)

$ lvs -a -o devices 5tb.Toshiba-Lot/raid5
  Devices                                                                                                                                                                            
  raid5_rimage_0(0),raid5_rimage_1(0),raid5_rimage_2(0),raid5_rimage_3(0),raid5_rimage_4(0),raid5_rimage_5(0),raid5_rimage_6(0),raid5_rimage_7(0),raid5_rimage_8(0),raid5_rimage_9(0)

Where are the devices?

Do whole VG not just LV(which makes no sense)..
$ lvs -a -o devices 5tb.Toshiba-Lot
  Devices                                                                                                                                                                            
  /dev/sdar(0),/dev/sdas(0),/dev/sdat(0),/dev/sdau(0)                                                                                                                                
  raid5_rimage_0(0),raid5_rimage_1(0),raid5_rimage_2(0),raid5_rimage_3(0),raid5_rimage_4(0),raid5_rimage_5(0),raid5_rimage_6(0),raid5_rimage_7(0),raid5_rimage_8(0),raid5_rimage_9(0)
  /dev/sdaf(1)                                                                                                                                                                       
  /dev/sdag(1)                                                                                                                                                                       
  /dev/sdah(1)                                                                                                                                                                       
  /dev/sdai(1)                                                                                                                                                                       
  /dev/sdaj(1)                                                                                                                                                                       
  /dev/sdak(1)                                                                                                                                                                       
  /dev/sdal(1)                                                                                                                                                                       
  /dev/sdam(1)                                                                                                                                                                       
  /dev/sdan(1)                                                                                                                                                                       
  /dev/sdao(1)                                                                                                                                                                       
  /dev/sdaf(0)                                                                                                                                                                       
  /dev/sdag(0)                                                                                                                                                                       
  /dev/sdah(0)                                                                                                                                                                       
  /dev/sdai(0)                                                                                                                                                                       
  /dev/sdaj(0)                                                                                                                                                                       
  /dev/sdak(0)                                                                                                                                                                       
  /dev/sdal(0)                                                                                                                                                                       
  /dev/sdam(0)                                                                                                                                                                       
  /dev/sdan(0)                                                                                                                                                                       
  /dev/sdao(0)


It would be really nice, great! to have a command that would give out that info, when one needs to see one specific LV's phy devices.


Version-Release number of selected component (if applicable):

lvm2-2.02.177-4.el7.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Corey Marthaler 2018-11-07 18:39:28 UTC
Is "+devices" the output mapping you're looking for?

[root@host-073 ~]# pvscan
  PV /dev/sda1   VG myvg            lvm2 [<12.49 GiB / 11.15 GiB free]
  PV /dev/sdc1   VG myvg            lvm2 [<12.49 GiB / 11.15 GiB free]
  PV /dev/sdd1   VG myvg            lvm2 [<12.49 GiB / 11.15 GiB free]

[root@host-073 ~]# lvs -a -o +devices
  LV               VG            Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                              
  mylv             myvg          rwi-a-r---   2.00g                                                       mylv_rimage_0(0),mylv_rimage_1(0),mylv_rimage_2(0)   
  mylv2            myvg          rwi-a-r---   2.00g                                                       mylv2_rimage_0(0),mylv2_rimage_1(0),mylv2_rimage_2(0)
  [mylv2_rimage_0] myvg          iwi-aor--- 684.00m                                                       /dev/sda1(171)                                       
  [mylv2_rimage_1] myvg          iwi-aor--- 684.00m                                                       /dev/sdc1(171)                                       
  [mylv2_rimage_2] myvg          iwi-aor--- 684.00m                                                       /dev/sdd1(171)                                       
  [mylv_rimage_0]  myvg          iwi-aor--- 684.00m                                                       /dev/sda1(0)                                         
  [mylv_rimage_1]  myvg          iwi-aor--- 684.00m                                                       /dev/sdc1(0)                                         
  [mylv_rimage_2]  myvg          iwi-aor--- 684.00m                                                       /dev/sdd1(0)                                         

[root@host-073 ~]# lvs -a -o +devices myvg
  LV               VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                              
  mylv             myvg rwi-a-r---   2.00g                                                     mylv_rimage_0(0),mylv_rimage_1(0),mylv_rimage_2(0)   
  mylv2            myvg rwi-a-r---   2.00g                                                     mylv2_rimage_0(0),mylv2_rimage_1(0),mylv2_rimage_2(0)
  [mylv2_rimage_0] myvg iwi-aor--- 684.00m                                                     /dev/sda1(171)                                       
  [mylv2_rimage_1] myvg iwi-aor--- 684.00m                                                     /dev/sdc1(171)                                       
  [mylv2_rimage_2] myvg iwi-aor--- 684.00m                                                     /dev/sdd1(171)                                       
  [mylv_rimage_0]  myvg iwi-aor--- 684.00m                                                     /dev/sda1(0)                                         
  [mylv_rimage_1]  myvg iwi-aor--- 684.00m                                                     /dev/sdc1(0)                                         
  [mylv_rimage_2]  myvg iwi-aor--- 684.00m                                                     /dev/sdd1(0)                                         

[root@host-073 ~]# vgs -a -o +devices
  VG            #PV #LV #SN Attr   VSize  VFree   Devices                                              
  myvg            3   2   0 wz--n- 37.46g <33.46g mylv_rimage_0(0),mylv_rimage_1(0),mylv_rimage_2(0)   
  myvg            3   2   0 wz--n- 37.46g <33.46g mylv2_rimage_0(0),mylv2_rimage_1(0),mylv2_rimage_2(0)
  myvg            3   2   0 wz--n- 37.46g <33.46g /dev/sda1(0)                                         
  myvg            3   2   0 wz--n- 37.46g <33.46g /dev/sdc1(0)                                         
  myvg            3   2   0 wz--n- 37.46g <33.46g /dev/sdd1(0)                                         
  myvg            3   2   0 wz--n- 37.46g <33.46g /dev/sda1(171)                                       
  myvg            3   2   0 wz--n- 37.46g <33.46g /dev/sdc1(171)                                       
  myvg            3   2   0 wz--n- 37.46g <33.46g /dev/sdd1(171)

Comment 3 lejeczek 2018-11-08 17:28:26 UTC
Nope, it is not. You can see I was using: -o devices.
One more time:

$ lvs --segments -a -o +devices 5tb.Toshiba-Lot/raid5
  LV    VG              Attr       #Str Type  SSize  Devices                                                                                                                                                                            
  raid5 5tb.Toshiba-Lot rwi-a-r---   10 raid5 40.94t raid5_rimage_0(0),raid5_rimage_1(0),raid5_rimage_2(0),raid5_rimage_3(0),raid5_rimage_4(0),raid5_rimage_5(0),raid5_rimage_6(0),raid5_rimage_7(0),raid5_rimage_8(0),raid5_rimage_9(0)

And like I said...
It would be really nice, great! to have a command that would give out that info, when one needs to see one SPECIFIC(not the whole lot) LV's phy devices.

I compared an output of raid0:

/dev/sdar(0),/dev/sdas(0),/dev/sdat(0),/dev/sdau(0)

where lvm resolves back to dm devices, so in the output of the same command for raid5(>?) we would also get the same/similar list of device mapper/block devices.

Comment 4 Jonathan Earl Brassow 2018-11-15 19:11:21 UTC
logical volumes that use the dm-raid target (segment types: raid0,raid1,raid10,raid4/5/6 - not "striped" or "mirror") will have logical volumes as the sub-LVs that compose the array.  You will need to drill down into those sub-LVs to get the devices they are on.

Many logical volume types have this property where they are built upon lower-level logical volumes - the raid types, thin-provisioning, caching, etc.

Comment 5 lejeczek 2018-11-15 23:38:34 UTC
Maybe as a feature request? - LVM is already pretty neat toolset with fantastic man pages, but if there was something that could make the whole experience even better then that would be this thing in my option. So we admins/users would not have drill any further.

many thanks, L.