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 1354650

Summary: raid0 needs a default stripe number
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 7.3   
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: 2016-11-04 04:15:36 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 2016-07-11 20:47:33 UTC
Description of problem:
All other raid types have a default.

[root@host-082 ~]# lvcreate --type raid1 -L 100M test
  Logical volume "lvol0" created.

[root@host-082 ~]# lvcreate --type raid4 -L 100M test
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 112.00 MiB (28 extents).
  Logical volume "lvol1" created.

[root@host-082 ~]# lvcreate --type raid5 -L 100M test
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 112.00 MiB (28 extents).
  Logical volume "lvol2" created.

[root@host-082 ~]# lvcreate --type raid6 -L 100M test
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 120.00 MiB (30 extents).
WARNING: ext2 signature detected on /dev/test/lvol3 at offset 1080. Wipe it? [y/n]: y
  Wiping ext2 signature on /dev/test/lvol3.
  Logical volume "lvol3" created.

[root@host-082 ~]# lvcreate --type raid10 -L 100M test
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 112.00 MiB (28 extents).
  Logical volume "lvol4" created.

[root@host-082 ~]# lvcreate --type raid0 -L 100M test
  Segment type 'raid0' requires 2 or more stripes.


Version-Release number of selected component (if applicable):
3.10.0-419.el7.x86_64

lvm2-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
lvm2-libs-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
lvm2-cluster-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-libs-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-event-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-event-libs-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-persistent-data-0.6.2-0.1.rc8.el7    BUILT: Wed May  4 02:56:34 CDT 2016
cmirror-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
sanlock-3.3.0-1.el7    BUILT: Wed Feb 24 09:52:30 CST 2016
sanlock-lib-3.3.0-1.el7    BUILT: Wed Feb 24 09:52:30 CST 2016
lvm2-lockd-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016

Comment 2 Heinz Mauelshagen 2016-07-13 09:58:09 UTC
When creating raid4/5/6/10 LVs without requesting stripes or providing a PV list
on the command line, all PVs of the VG will be tried using for stripes. That'll either cause unexpected many stripes (e.g. 60 with 60 PVs in the VG) or fail in case the current lvm limit for maximum RAID stripes is surpassed

I propose new defaults for the various raid mappings, in particular to avoid that 'stripe bomb' occuring without -i/--stripes provided:

raid0: 2 stripes (i.e. 2 stripes net capacity)
raid4/5/6: 3 stripes total (i.e. 2 stripes net capacity)
raid6: 5 stripes (i.e. 3 stripes net capacity)
raid10: 4 stripes (capacity depends on raid10 data copies, e.g. 2 data copies = net 2 stripes capacity)

Comment 3 Heinz Mauelshagen 2016-07-13 17:22:42 UTC
As a future direction, we may add config options for the number of stripes so that those can be defined in lvm.conf and/or set/overridden with command line option --config.

Comment 4 Heinz Mauelshagen 2016-07-13 17:42:27 UTC
line "raid4/5/6: 3 stripes total (i.e. 2 stripes net capacity)" in comment #2

should read

"raid4/5: 3 stripes total (i.e. 2 stripes net capacity)"

Comment 5 Heinz Mauelshagen 2016-07-13 19:46:56 UTC
Upstream commit 3928c96a37941d765bf467d82502cd2aec7fd809
sets defaults as of comments #2/#4

Comment 6 Heinz Mauelshagen 2016-07-20 15:26:26 UTC
Upstream commit 7eb79091937d01eec51fc6a034879a6fe607231d makes the previous
behaviour of taking all devices to stripe across when none have been provided via -i/--stripes configurable via
"activation/raid_stripe_all_devices = [0/1]"
in lvm.conf(5).

That option defaults to '0', hence supplying new defaults as of comments #2/#4
but provides the user with requesting the old behaviour in case his deployments
rely on it.

Comment 8 Corey Marthaler 2016-09-28 22:31:30 UTC
Fix verified in the latest rpms.

3.10.0-510.el7.x86_64

lvm2-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
lvm2-libs-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
lvm2-cluster-2.02.166-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-libs-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-event-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-event-libs-1.02.135-1.el7    BUILT: Wed Sep 28 02:26:52 CDT 2016
device-mapper-persistent-data-0.6.3-1.el7    BUILT: Fri Jul 22 05:29:13 CDT 2016



[root@host-116 ~]# lvcreate --type raid0 -L 100M vg
  Using default stripesize 64.00 KiB.
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 104.00 MiB (26 extents).
  Logical volume "lvol0" created.

[root@host-116 ~]# lvcreate --type raid0_meta -L 100M vg
  Using default stripesize 64.00 KiB.
  Rounding size 100.00 MiB (25 extents) up to stripe boundary size 104.00 MiB (26 extents).
  Logical volume "lvol1" created.

  lvol0            vg rwi-a-r--- 104.00m   lvol0_rimage_0(0),lvol0_rimage_1(0)               
  [lvol0_rimage_0] vg iwi-aor---  52.00m   /dev/sda1(0)                                      
  [lvol0_rimage_1] vg iwi-aor---  52.00m   /dev/sdb1(0)                                      

  lvol1            vg rwi-a-r--- 104.00m   lvol1_rimage_0(0),lvol1_rimage_1(0)               
  [lvol1_rimage_0] vg iwi-aor---  52.00m   /dev/sda1(14)                                     
  [lvol1_rimage_1] vg iwi-aor---  52.00m   /dev/sdb1(14)                                     
  [lvol1_rmeta_0]  vg ewi-aor---   4.00m   /dev/sda1(13)                                     
  [lvol1_rmeta_1]  vg ewi-aor---   4.00m   /dev/sdb1(13)

Comment 10 errata-xmlrpc 2016-11-04 04:15:36 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.

https://rhn.redhat.com/errata/RHBA-2016-1445.html