Bug 1483530
| Summary: | lvconvert --type raid1 LV allows --stripes option | ||
|---|---|---|---|
| Product: | [Community] LVM and device-mapper | Reporter: | Eric Ren <zren> |
| Component: | lvm2 | Assignee: | Marian Csontos <mcsontos> |
| lvm2 sub component: | Changing Logical Volumes | QA Contact: | cluster-qe <cluster-qe> |
| Status: | ASSIGNED --- | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | high | CC: | agk, heinzm, jbrassow, jo4rht, mcsontos, msnitzer, prajnoha, zkabelac, zren |
| Version: | 2.02.172 | Keywords: | Reopened |
| Target Milestone: | --- | Flags: | rule-engine:
lvm-technical-solution?
rule-engine: lvm-test-coverage? |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-08-22 09:57:10 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: | |||
I'm not sure if it's a valid issue. Feel free to close this bug if it's invalid, and I will appreciate if someone can explain it a bit. Are you you mistaking 'raid1' with 'raid10' here if you seek for redundancy & performance. raid1 is using linears. raid10 has striped legs. (In reply to Zdenek Kabelac from comment #2) > Are you you mistaking 'raid1' with 'raid10' here if you seek for > redundancy & performance. > > raid1 is using linears. > > raid10 has striped legs. Looks like conversion from "linear" to "raid10" is not supported. # lvremove -f vg1 Logical volume "lv1" successfully removed # lvcreate -L1.5G -n lv1 vg1 /dev/loop0 Logical volume "lv1" created. # lvconvert --type raid10 -m 1 --stripes 2 vg1/lv1 /dev/loop1 /dev/loop2 Using default stripesize 64.00 KiB. Conversion operation not yet supported. On the old version, it creates "striped" new leg in such conversion.
===
# lvm version
LVM version: 2.02.98(2) (2012-10-15)
Library version: 1.03.01 (2011-10-15)
Driver version: 4.25.0
# lvcreate -L1.5G -n lv1 vg1 /dev/loop0
Logical volume "lv1" created
# lvconvert -m 1 --stripes 2 vg1/lv1 /dev/loop1 /dev/loop2
Using default stripesize 64.00 KiB
vg1/lv1: Converted: 0.3%
vg1/lv1: Converted: 8.3%
vg1/lv1: Converted: 16.1%
vg1/lv1: Converted: 24.2%
vg1/lv1: Converted: 32.0%
vg1/lv1: Converted: 40.1%
vg1/lv1: Converted: 47.9%
vg1/lv1: Converted: 56.0%
vg1/lv1: Converted: 64.1%
vg1/lv1: Converted: 71.9%
vg1/lv1: Converted: 79.2%
vg1/lv1: Converted: 86.2%
vg1/lv1: Converted: 93.5%
vg1/lv1: Converted: 100.0%
# lvdisplay -mav vg1/lv1_mimage_0
Using logical volume(s) on command line
--- Logical volume ---
LV Name /dev/vg1/lv1_mimage_0
VG Name vg1
LV UUID dtZefO-bPB4-cERp-3fC3-n1PI-Okcz-51eCYT
LV Write Access read/write
LV Creation host, time b194, 2017-08-22 10:23:40 +0800
LV Status available
# open 1
LV Size 1.50 GiB
Current LE 384
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 1024
Block device 253:12
--- Segments ---
Logical extent 0 to 383:
Type linear
Physical volume /dev/loop0
Physical extents 0 to 383
# lvdisplay -mav vg1/lv1_mimage_1
--- Logical volume ---
LV Name /dev/vg1/lv1_mimage_1
VG Name vg1
LV UUID UOFwA4-Az0e-lO8e-VtmM-vUxg-jPEC-s6Kmbc
LV Write Access read/write
LV Creation host, time b194, 2017-08-22 10:23:40 +0800
LV Status available
# open 1
LV Size 1.50 GiB
Current LE 384
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 1024
Block device 253:13
--- Segments ---
Logical extent 0 to 383:
Type striped
Stripes 2
Stripe size 64.00 KiB
Stripe 0:
Physical volume /dev/loop1
Physical extents 0 to 191
Stripe 1:
Physical volume /dev/loop2
Physical extents 0 to 191
===
Old version was using mirror not raid target (using md). You can still make mirror of stripes with `--type mirror`, but I am not sure though you would gain anything with one leg linear and other stripe... The combination of -m and -i should be disabled for RAID1. (In reply to Marian Csontos from comment #5) > Old version was using mirror not raid target (using md). > > You can still make mirror of stripes with `--type mirror`, but I am not sure > though you would gain anything with one leg linear and other stripe... > > The combination of -m and -i should be disabled for RAID1. You're right! The command line blow works for current version: === # lvconvert --type mirror -m1 --stripes 2 vg1/lv1 /dev/loop1 /dev/loop2 Using default stripesize 64.00 KiB. vg1/lv1: Converted: 0.0% vg1/lv1: Converted: 3.1% ... vg1/lv1: Converted: 97.4% vg1/lv1: Converted: 100.0% # lvdisplay -mav vg1/lv1_mimage_1 Using logical volume(s) on command line. --- Logical volume --- Internal LV Name lv1_mimage_1 VG Name vg1 LV UUID nmHFLQ-WIyk-0f8J-WiqZ-hkZV-AVlX-rOwT4w LV Write Access read/write LV Creation host, time linux-nncx, 2017-08-22 17:43:37 +0800 LV Status available # open 1 LV Size 1.50 GiB Current LE 384 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 1024 Block device 254:3 --- Segments --- Logical extents 0 to 383: Type striped Stripes 2 Stripe size 64.00 KiB Stripe 0: Physical volume /dev/loop1 Physical extents 0 to 191 Stripe 1: Physical volume /dev/loop2 Physical extents 0 to 191 === Thanks very much for you! I'm closing this. Still commands should not simply ignore incompatible options. Patches posted to lvm-devel: https://www.redhat.com/archives/lvm-devel/2017-August/msg00070.html Also available on dev-mcsontos-stripes-raid1 branch. Merge please. As of recent version 2.03.15-2.1 (openSUSE Tumbleweed 20220328), `lvconvert` still accepts `--type raid1 --mirrors 1 --stripes 3` and silently produces a linear leg. Please show an error message and consider keeping support for `--type mirror` to allow manual conversion to striped LV, e.g. as in the accepted answer in https://unix.stackexchange.com/questions/348873/convert-a-single-drive-lvm-volume-to-a-striped-volume-across-3-drives |
Description of problem: I want to lvconvert an existing linear LV into rai1 LV, and the new leg of raid1 will consist of 2 PVs. I hope the new leg is "striped" type, but I get "linear" type which is not expected, because I assume "striped" has better performance than "linear". Version-Release number of selected component (if applicable): localhost:~/raid1-stripe # lvm version LVM version: 2.02.172(2) (2017-06-28) Library version: 1.03.01 (2017-06-28) Driver version: 4.35.0 How reproducible: Steps to Reproduce: 1. create VG containing 3 PVs: the size of PV1 equals to the sum size of the rest 2 PVs. # dd if=/dev/zero of=disk1.raw bs=1G count=2 # dd if=/dev/zero of=disk2.raw bs=1G count=1 # dd if=/dev/zero of=disk3.raw bs=1G count=1 # losetup -f disk1.raw # losetup -f disk2.raw # losetup -f disk3.raw # vgcreate vg1 /dev/loop0 /dev/loop1 /dev/loop2 Physical volume "/dev/loop0" successfully created. Physical volume "/dev/loop1" successfully created. Physical volume "/dev/loop2" successfully created. Volume group "vg1" successfully created 2. create an existing linear LV # lvcreate -L1.5G -n lv1 vg1 /dev/loop0 Logical volume "lv1" created. 3. lvconvert lv1 into raid1 # lvconvert --type raid1 -m 1 --stripes 2 vg1/lv1 /dev/loop1 /dev/loop2 Are you sure you want to convert linear LV vg1/lv1 to raid1 with 2 images enhancing resilience? [y/n]: y Logical volume vg1/lv1 successfully converted. 4. lvdisplay shows the "lv1_rimage_1" is "linear" type. # lvs -a lv1 vg1 rwi-a-r--- 1.50g [lv1_rimage_0] vg1 iwi-aor--- 1.50g [lv1_rimage_1] vg1 Iwi-aor--- 1.50g [lv1_rmeta_0] vg1 ewi-aor--- 4.00m [lv1_rmeta_1] vg1 ewi-aor--- 4.00m # lvdisplay -mav vg1/lv1_rimage_1 --- Logical volume --- Internal LV Name lv1_rimage_1 VG Name vg1 LV UUID dB3CG1-MXi3-9cBE-kpoa-a4Ul-lpZF-LDIdvI LV Write Access read/write LV Creation host, time localhost, 2017-08-21 18:18:24 +0800 LV Status available # open 1 LV Size 1.50 GiB Current LE 384 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 1024 Block device 254:12 --- Segments --- Logical extents 0 to 253: Type linear Physical volume /dev/loop1 Physical extents 1 to 254 Logical extents 254 to 383: Type linear Physical volume /dev/loop2 Physical extents 0 to 129 Actual results: The new leg of raid1 is "linear" type. Expected results: The new leg of raid1 is "striped" type.