Bug 1647549 - raid volume phy devices - should 'lvs -o devices' not show all phy devices?
Summary: raid volume phy devices - should 'lvs -o devices' not show all phy devices?
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-07 18:05 UTC by lejeczek
Modified: 2021-09-03 12:39 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-15 19:11:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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