Bug 834031 - RFE: Give better error messages when using the wrong stripe (-i) or mirror (-m) option with wrong raid type
RFE: Give better error messages when using the wrong stripe (-i) or mirror (-...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.3
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Jonathan Earl Brassow
Cluster QE
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-20 12:40 EDT by Corey Marthaler
Modified: 2013-02-21 03:10 EST (History)
10 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:10:50 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker 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 16:30:45 EST

  None (edit)
Description Corey Marthaler 2012-06-20 12:40:41 EDT
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 02:01:48 EDT
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 19:59:06 EDT
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 13:33:51 EDT
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 08:13:54 EST
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 03:10:50 EST
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.