Bug 834031 - RFE: Give better error messages when using the wrong stripe (-i) or mirror (-m) option with wrong raid type
Summary: RFE: Give better error messages when using the wrong stripe (-i) or mirror (-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.3
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-20 16:40 UTC by Corey Marthaler
Modified: 2018-12-01 17:55 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.97-2.el6
Doc Type: Enhancement
Doc Text:
Previously, it was possible for a user to place a bad argument on the command line when creating a RAID logical volume (e.g. '--mirrors' for RAID5). This would produce erroneous and unexpected results. Invalid arguments are now caught and reported.
Clone Of:
Environment:
Last Closed: 2013-02-21 08:10:50 UTC
Target Upstream Version:


Attachments (Terms of Use)


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

Description Corey Marthaler 2012-06-20 16:40:41 UTC
Description of problem:
I dont think we support stripe+mirror raids until raid 10 comes out, so shouldn't all of the following examples just have a simple error message stating that you're using the wrong stripe/mirror option with the given raid type.

[root@hayes-01 ~]# pvscan
  PV /dev/etherd/e1.1p1    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p10   VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p2    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p3    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p4    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p5    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p6    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p7    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p8    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]
  PV /dev/etherd/e1.1p9    VG hayes        lvm2 [908.23 GiB / 908.23 GiB free]

# RAID1 -m1 -i2
[root@hayes-01 ~]# lvcreate --type raid1 -m 1 -i 2 -n test -L 100M hayes
  Using default stripesize 64.00 KiB
  Rounding size (25 extents) up to stripe boundary size (26 extents)
  WARNING: Ignoring RAID1 stripe size
  device-mapper: resume ioctl on  failed: Invalid argument
  Unable to resume hayes-test (253:11)
  Failed to activate new LV.
  Attempted to decrement suspended device counter below zero.

# RAID1 -i2
[root@hayes-01 ~]# lvcreate --type raid1 -i 2 -n test -L 100M hayes
  Using default stripesize 64.00 KiB
  Rounding size (25 extents) up to stripe boundary size (26 extents)
  WARNING: Ignoring RAID1 stripe size
  device-mapper: resume ioctl on  failed: Invalid argument
  Unable to resume hayes-test (253:11)
  Failed to activate new LV.
  Attempted to decrement suspended device counter below zero.

# RAID4 -m1 
[root@hayes-01 ~]# lvcreate --type raid4 -m 1 -n test -L 100M hayes
  Number of stripes must be at least 2 for raid4
  Run `lvcreate --help' for more information.

# RAID4 -m1 -i2
[root@hayes-01 ~]# lvcreate --type raid4 -i 2 -m 1 -n test -L 100M hayes
  Using default stripesize 64.00 KiB
  Rounding size (25 extents) up to stripe boundary size (26 extents)
  Logical volume "test" created

# This worked? did it just add the -m and -i values together?
[root@hayes-01 ~]# lvs -a -o +devices
  LV              VG     Attr     LSize    Devices
  test            hayes  rwi-a-r- 104.00m test_rimage_0(0),test_rimage_1(0),test_rimage_2(0),test_rimage_3(0),test_rimage_4(0)
  [test_rimage_0] hayes  iwi-aor-  52.00m /dev/etherd/e1.1p1(1)
  [test_rimage_1] hayes  iwi-aor-  52.00m /dev/etherd/e1.1p10(1)
  [test_rimage_2] hayes  iwi-aor-  52.00m /dev/etherd/e1.1p2(1)
  [test_rimage_3] hayes  iwi-aor-  52.00m /dev/etherd/e1.1p3(1)
  [test_rimage_4] hayes  iwi-aor-  52.00m /dev/etherd/e1.1p4(1)
  [test_rmeta_0]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p1(0)
  [test_rmeta_1]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p10(0)
  [test_rmeta_2]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p2(0)
  [test_rmeta_3]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p3(0)
  [test_rmeta_4]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p4(0)

[root@hayes-01 ~]# lvremove hayes
Do you really want to remove active logical volume test? [y/n]: y
  Logical volume "test" successfully removed


# RAID5 -m1
[root@hayes-01 ~]# lvcreate --type raid5 -m 1 -n test -L 100M hayes
  Number of stripes must be at least 2 for raid5
  Run `lvcreate --help' for more information.

# RAID6 -m1
[root@hayes-01 ~]# lvcreate --type raid6 -m 1 -n test -L 100M hayes
  Number of stripes must be at least 3 for raid6
  Run `lvcreate --help' for more information.

# RAID6 -m1 -i3
[root@hayes-01 ~]# lvcreate --type raid6 -i 3 -m 1 -n test -L 100M hayes
  Using default stripesize 64.00 KiB
  Rounding size (25 extents) up to stripe boundary size (27 extents)
  Logical volume "test" created

# This worked? did it just add the -m and -i values together?
[root@hayes-01 ~]# lvs -a -o +devices
  LV              VG     Attr     LSize   Devices
  test            hayes  rwi-a-r- 108.00m test_rimage_0(0),test_rimage_1(0),test_rimage_2(0),test_rimage_3(0),test_rimage_4(0),test_rimage_5(0),test_rimage_6(0),test_rimage_7(0)
  [test_rimage_0] hayes  iwi-aor-  36.00m /dev/etherd/e1.1p1(1)
  [test_rimage_1] hayes  iwi-aor-  36.00m /dev/etherd/e1.1p10(1)
  [test_rimage_2] hayes  iwi-aor-  36.00m /dev/etherd/e1.1p2(1)
  [test_rimage_3] hayes  iwi-aor-  36.00m /dev/etherd/e1.1p3(1)
  [test_rimage_4] hayes  iwi-aor-  36.00m /dev/etherd/e1.1p4(1)
  [test_rimage_5] hayes  iwi-aor-  36.00m /dev/etherd/e1.1p5(1)
  [test_rimage_6] hayes  iwi-aor-  36.00m /dev/etherd/e1.1p6(1)
  [test_rimage_7] hayes  iwi-aor-  36.00m /dev/etherd/e1.1p7(1)
  [test_rmeta_0]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p1(0)
  [test_rmeta_1]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p10(0)
  [test_rmeta_2]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p2(0)
  [test_rmeta_3]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p3(0)
  [test_rmeta_4]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p4(0)
  [test_rmeta_5]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p5(0)
  [test_rmeta_6]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p6(0)
  [test_rmeta_7]  hayes  ewi-aor-   4.00m /dev/etherd/e1.1p7(0)


Version-Release number of selected component (if applicable):
2.6.32-278.el6.x86_64

lvm2-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
lvm2-libs-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
lvm2-cluster-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
udev-147-2.41.el6    BUILT: Thu Mar  1 13:01:08 CST 2012
device-mapper-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-libs-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-event-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
device-mapper-event-libs-1.02.74-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012
cmirror-2.02.95-10.el6    BUILT: Fri May 18 03:26:00 CDT 2012

Comment 1 RHEL Product and Program Management 2012-07-10 06:01:48 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 2 RHEL Product and Program Management 2012-07-10 23:59:06 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 3 Jonathan Earl Brassow 2012-08-08 17:33:51 UTC
commit de3b1c4506ff502f00a360a83800f35a31e1b42e
Author: Jonathan Brassow <jbrassow@redhat.com>
Date:   Wed Aug 8 12:32:27 2012 -0500

    RAID: Improve RAID argument handling.
    
    Disallow '-m' for RAID types that have no mirror component and disallow
    '-i' argument for RAID types that have no stripe component.

Comment 5 Nenad Peric 2012-11-16 13:13:54 UTC
The commands exit with a warning now, not creating any lv. 



tested with:

lvm2-2.02.98-3.el6.x86_64
kernel-2.6.32-339.el6.x86_64
device-mapper-1.02.77-3.el6.x86_64

Comment 6 errata-xmlrpc 2013-02-21 08:10:50 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.