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 865850 - LVM RAID: Sync state of RAID 4/5/6 not displayed by 'lvs' (or anything else)
Summary: LVM RAID: Sync state of RAID 4/5/6 not displayed by 'lvs' (or anything else)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.3
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-12 15:55 UTC by Jonathan Earl Brassow
Modified: 2013-02-21 08:14 UTC (History)
12 users (show)

Fixed In Version: lvm2-2.02.98-2.el6
Doc Type: Bug Fix
Doc Text:
Previously, the degree to which RAID 4/5/6 logical volumes had completed their initial array synchronization (i.e. initial parity calculations) was not printed in the output of the 'lvs' command. This information is now printed under a heading that has been changed from "Copy%" to "Cpy%Sync". Users can request the "Cpy%Sync" information directly via 'lvs' with either of the following options: ~> lvs -o copy_percent ~> lvs -o sync_percent
Clone Of:
Environment:
Last Closed: 2013-02-21 08:14:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0501 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-02-20 21:30:45 UTC

Description Jonathan Earl Brassow 2012-10-12 15:55:23 UTC
RAID 4/5/6 go through an initialization phase to do initial parity calculations.  This is similar to mirror or RAID1/10 initialization/synchronization phases.  The mirror, pvmove volumes and RAID1/10 print their progress to the 'copy_percent' field.  This has not seemed appropriate for RAID 4/5/6 - "copy" doesn't really apply.

There either needs to be a new field or the copy_percent field should encompase both and the header name should change.

Comment 3 Jonathan Earl Brassow 2012-10-24 02:24:34 UTC
Changes committed upstream (unit tests are shown in commit messages):

*** PLEASE NOTE: 2 CHECK-INS COMPOSE THIS FIX  ***

commit e1917809477c4850cc1094121001d61a2b70ef26
Author: Jonathan Brassow <jbrassow>
Date:   Tue Oct 23 21:19:27 2012 -0500

    RAID:  Make RAID 4/5/6 display sync status under heading s/Copy%/Cpy%Sync
    
    The heading 'Copy%' is specific to PVMOVE volumes, but can be generalized
    to apply to LVM mirrors also.  It is a bit awkward to use 'Copy%' for
    RAID 4/5/6, however - 'Sync%' would be more appropriate.  This is why
    RAID 4/5/6 have not displayed their sync status by any means available to
    'lvs' yet.
    
    Example (old):
    [root@hayes-02 lvm2]# lvs vg
      LV      VG   Attr      LSize  Pool Origin Data%  Move Log Cpy%Sy Convert
      lv    vg   -wi-a----  1.00g
      raid1 vg   rwi-a-r--  1.00g                             100.00
      raid4 vg   rwi-a-r--  1.01g
      raid5 vg   rwi-a-r--  1.01g
      raid6 vg   rwi-a-r--  1.01g
    
    This patch changes the heading to 'Cpy%Sync' and allows RAID 4/5/6 to print
    their sync percent in this field.
    
    Example (new):
    [root@hayes-02 lvm2]# lvs vg
      LV    VG   Attr      LSize Pool Origin Data%  Move Log Cpy%Sync Convert
      lv    vg   -wi-a---- 1.00g
      raid1 vg   rwi-a-r-- 1.00g                               100.00
      raid4 vg   rwi-a-r-- 1.01g                               100.00
      raid5 vg   rwi-a-r-- 1.01g                               100.00
      raid6 vg   rwi-a-r-- 1.01g                               100.00

commit 6db461e3b0d3fbc394fe2ed2a7d6a3c070453874
Author: Jonathan Brassow <jbrassow>
Date:   Tue Oct 23 20:33:54 2012 -0500

    mirror/raid:  Move 'copy_percent' to common code (mirror.c -> lv_manip.c)
    
    The 'copy_percent' function takes the 'extents_copied' field from each
    segment in an LV to create the numerator for the ratio that is to
    become the copy_percent.  (Otherwise known as the 'sync' percent for
    non-pvmove uses, like mirror LVs and RAID LVs.)  This function safely
    works on RAID - not just mirrors - so it is better to have it in
    lv_manip.c rather than mirror.c.
    
    There's a lot of different functions that do a lot of different things
    in lv_manip.c, so I placed the function near a function in lv_manip.c
    that it was close to in metadata-exported.h.  Different placement in the
    file or a different name for the function may be useful.

Comment 4 Jonathan Earl Brassow 2012-10-24 02:31:00 UTC
QA test requirements:

1) Show that 'lvs' outputs the sync% for RAID1/4/5/6/10, mirror, and pvmove
2) Show that 'lvs -o +sync_percent' is another way to get the sync %'age  (the default way is to use the legacy 'lvs -o copy_percent', which is a default column in 'lvs' output).

Comment 6 Nenad Peric 2013-01-28 13:17:13 UTC
(07:14:25) [root@r6-node01:~]$ lvs -o +sync_percent,devices
  LV      VG       Attr      LSize Pool Origin Data%  Move Log         Cpy%Sync Convert Cpy%Sync Devices                                                 
  lv_root VolGroup -wi-ao--- 7.54g                                                               /dev/vda2(0)                                            
  lv_swap VolGroup -wi-ao--- 1.97g                                                               /dev/vda2(1930)                                         
  mirror  vg       mwi-a-m-- 1.95g                         mirror_mlog    68.40            68.40 mirror_mimage_0(0),mirror_mimage_1(0),mirror_mimage_2(0)

(07:14:29) [root@r6-node01:~]$ lvs -a -o+devices
  LV                VG       Attr      LSize Pool Origin Data%  Move Log         Cpy%Sync Convert Devices                                                 
  lv_root           VolGroup -wi-ao--- 7.54g                                                      /dev/vda2(0)                                            
  lv_swap           VolGroup -wi-ao--- 1.97g                                                      /dev/vda2(1930)                                         
  mirror            vg       mwi-a-m-- 1.95g                         mirror_mlog    72.20         mirror_mimage_0(0),mirror_mimage_1(0),mirror_mimage_2(0)
  [mirror_mimage_0] vg       Iwi-aom-- 1.95g                                                      /dev/sda1(0)                                            
  [mirror_mimage_1] vg       Iwi-aom-- 1.95g                                                      /dev/sdb1(0)                                            
  [mirror_mimage_2] vg       Iwi-aom-- 1.95g                                                      /dev/sdc1(0)                                            
  [mirror_mlog]     vg       lwi-aom-- 4.00m                                                      /dev/sde1(0)   



lvs omits device desply when using the option +sync_percent.
Why can't it display it the same as without +sync_percent?

Comment 7 Nenad Peric 2013-01-28 13:22:43 UTC
Disregard the comment.. I have missed -a.
Sorry. 

I need a coffee.. 

Marking this BZ verified with lvm2-2.02.98-8.el6.x86_64


(07:01:35) [root@r6-node01:~]$ lvs -o +sync_percent
  LV       VG       Attr      LSize   Pool Origin Data%  Move Log Cpy%Sync Convert Cpy%Sync
  lv_root  VolGroup -wi-ao---   7.54g                                                      
  lv_swap  VolGroup -wi-ao---   1.97g                                                      
  raid4_lv bigvg    rwi-a-r-- 800.00m                                27.50            27.50

(07:02:19) [root@r6-node01:~]$ lvs -o +sync_percent
  LV       VG       Attr      LSize   Pool Origin Data%  Move Log Cpy%Sync Convert Cpy%Sync
  lv_root  VolGroup -wi-ao---   7.54g                                                      
  lv_swap  VolGroup -wi-ao---   1.97g                                                      
  raid4_lv bigvg    rwi-a-r-- 800.00m                               100.00           100.00
  raid5_lv bigvg    rwi-a-r-- 804.00m                                17.41            17.41


(07:04:22) [root@r6-node01:~]$ lvs -o +sync_percent
  LV        VG       Attr      LSize   Pool Origin Data%  Move Log Cpy%Sync Convert Cpy%Sync
  lv_root   VolGroup -wi-ao---   7.54g                                                      
  lv_swap   VolGroup -wi-ao---   1.97g                                                      
  raid10_lv bigvg    rwi-a-r-- 804.00m                               100.00           100.00
  raid1_lv  bigvg    rwi-a-r-- 800.00m                                 8.00             8.00
  raid4_lv  bigvg    rwi-a-r-- 800.00m                               100.00           100.00
  raid5_lv  bigvg    rwi-a-r-- 804.00m                               100.00           100.00
  raid6_lv  bigvg    rwi-a-r-- 804.00m                                75.62            75.62

Comment 8 errata-xmlrpc 2013-02-21 08:14:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0501.html


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