Bug 855964

Summary: enhance the man page to better explain the parity device wrt -i stripe flag
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Jonathan Earl Brassow <jbrassow>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.3CC: agk, dwysocha, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, pschiffe, thornber, zkabelac
Target Milestone: rcKeywords: ManPageChange
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.98-4.el6 Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:13:38 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 Corey Marthaler 2012-09-10 19:14:11 UTC
Description of problem:
Didn't it used to be that -m 2 meant 3 mirror legs, and -i 2 meant 2 stripe legs?

Now I see that has changed wrt RAID stripes, but not non RAID stripes. What is the proper meaning of the -i flag?

# NON RAID STRIPE

[root@taft-04 ~]# lvcreate -i 1 -n stripe -L 150M raid_sanity
  Rounding up size to full physical extent 152.00 MiB
  Logical volume "stripe" created
[root@taft-04 ~]# lvs -a -o +devices
  LV      VG          Attr     LSize    Devices
  stripe  raid_sanity -wi-a--- 152.00m  /dev/sdb1(0)

[root@taft-04 ~]# lvcreate -i 2 -n stripe -L 150M raid_sanity
  Using default stripesize 64.00 KiB
  Rounding up size to full physical extent 152.00 MiB
  Logical volume "stripe" created
[root@taft-04 ~]# lvs -a -o +devices
  LV      VG          Attr     LSize    Devices
  stripe  raid_sanity -wi-a--- 152.00m  /dev/sdb1(0),/dev/sdd2(0)

[root@taft-04 ~]# lvcreate -i 3 -n stripe -L 150M raid_sanity
  Using default stripesize 64.00 KiB
  Rounding up size to full physical extent 152.00 MiB
  Rounding size (38 extents) up to stripe boundary size (39 extents)
  Logical volume "stripe" created
[root@taft-04 ~]# lvs -a -o +devices
  LV      VG          Attr     LSize    Devices
  stripe  raid_sanity -wi-a--- 156.00m  /dev/sdb1(0),/dev/sdd2(0),/dev/sdg2(0)



# RAID STRIPE

[root@taft-04 ~]# lvcreate -i 1 --type raid4 -n stripe -L 150M raid_sanity
  Number of stripes must be at least 2 for raid4
  Run `lvcreate --help' for more information.
[root@taft-04 ~]# lvcreate -i 2 --type raid4 -n stripe -L 150M raid_sanity
  Using default stripesize 64.00 KiB
  Rounding up size to full physical extent 152.00 MiB
  Logical volume "stripe" created
[root@taft-04 ~]# lvs -a -o +devices
  LV                VG          Attr     LSize    Devices
  stripe            raid_sanity rwi-a-r- 152.00m  stripe_rimage_0(0),stripe_rimage_1(0),stripe_rimage_2(0)
  [stripe_rimage_0] raid_sanity iwi-aor-  76.00m  /dev/sdb1(1)
  [stripe_rimage_1] raid_sanity iwi-aor-  76.00m  /dev/sdd2(1)
  [stripe_rimage_2] raid_sanity iwi-aor-  76.00m  /dev/sdg2(1)
  [stripe_rmeta_0]  raid_sanity ewi-aor-   4.00m  /dev/sdb1(0)
  [stripe_rmeta_1]  raid_sanity ewi-aor-   4.00m  /dev/sdd2(0)
  [stripe_rmeta_2]  raid_sanity ewi-aor-   4.00m  /dev/sdg2(0)

[root@taft-04 ~]# lvcreate -i 3 --type raid4 -n stripe -L 150M raid_sanity
  Using default stripesize 64.00 KiB
  Rounding up size to full physical extent 152.00 MiB
  Rounding size (38 extents) up to stripe boundary size (39 extents)
  Logical volume "stripe" created
[root@taft-04 ~]# lvs -a -o +devices
  LV                VG          Attr     LSize    Devices                                                                    
  stripe            raid_sanity rwi-a-r- 156.00m  stripe_rimage_0(0),stripe_rimage_1(0),stripe_rimage_2(0),stripe_rimage_3(0)
  [stripe_rimage_0] raid_sanity iwi-aor-  52.00m  /dev/sdb1(1)
  [stripe_rimage_1] raid_sanity iwi-aor-  52.00m  /dev/sdd2(1)
  [stripe_rimage_2] raid_sanity iwi-aor-  52.00m  /dev/sdg2(1)
  [stripe_rimage_3] raid_sanity iwi-aor-  52.00m  /dev/sde1(1)
  [stripe_rmeta_0]  raid_sanity ewi-aor-   4.00m  /dev/sdb1(0)
  [stripe_rmeta_1]  raid_sanity ewi-aor-   4.00m  /dev/sdd2(0)
  [stripe_rmeta_2]  raid_sanity ewi-aor-   4.00m  /dev/sdg2(0)
  [stripe_rmeta_3]  raid_sanity ewi-aor-   4.00m  /dev/sde1(0)


Version-Release number of selected component (if applicable):
2.6.32-279.el6.x86_64
lvm2-2.02.95-10.el6_3.1    BUILT: Tue Aug 28 09:31:04 CDT 2012
lvm2-libs-2.02.95-10.el6_3.1    BUILT: Tue Aug 28 09:31:04 CDT 2012
lvm2-cluster-2.02.95-10.el6_3.1    BUILT: Tue Aug 28 09:31:04 CDT 2012
udev-147-2.41.el6    BUILT: Thu Mar  1 13:01:08 CST 2012
device-mapper-1.02.74-10.el6_3.1    BUILT: Tue Aug 28 09:31:04 CDT 2012
device-mapper-libs-1.02.74-10.el6_3.1    BUILT: Tue Aug 28 09:31:04 CDT 2012
device-mapper-event-1.02.74-10.el6_3.1    BUILT: Tue Aug 28 09:31:04 CDT 2012
device-mapper-event-libs-1.02.74-10.el6_3.1    BUILT: Tue Aug 28 09:31:04 CDT 2012
cmirror-2.02.95-10.el6_3.1    BUILT: Tue Aug 28 09:31:04 CDT 2012

Comment 1 Corey Marthaler 2012-09-10 19:23:20 UTC
I'm forgetting about the parity disk. :( -i 2 equals two stripe disks plus one parity.

Comment 2 Jonathan Earl Brassow 2012-11-30 23:14:54 UTC
commit 83978cdec8aa6f6b6af2cb8937d64cc16b88cf18
Author: Jonathan Brassow <jbrassow>
Date:   Fri Nov 30 16:47:02 2012 -0600

    man page (lvcreate):  Better explain stripes option for RAID 4/5/6.
    
    Do a better job explaining the '--stripes/-i' option to lvcreate
    when it comes to RAID 4/5/6.  The extra devices needed for parity
    are implicitly added to the argument given.  So a 5-device RAID6
    logical volume is created with '-i 3' - indicating 3 stripes plus
    the implicit 2 devices needed for RAID6.


Description now reads:
      -i, --stripes Stripes
              Gives the number of stripes.  This is equal to the  number  of
              physical volumes to scatter the logical volume.  When creating
              a RAID 4/5/6 logical volume, the extra devices which are  nec‐
              essary  for  parity  are internally accounted for.  Specifying
              '-i 3' would use 3 devices  for  striped  logical  volumes,  4
              devices for RAID 4/5, and 5 devices for RAID 6.

Comment 4 Nenad Peric 2012-12-14 09:19:57 UTC
Checked the man pages and compared with lvcreate functionality (ie. -i 3 with --type raid4 used 4 devices, 3 stripe + internally accounted for parity). 

Marking verified with:

lvm2-2.02.98-5.el6

Comment 5 errata-xmlrpc 2013-02-21 08:13:38 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