Bug 753203

Summary: Unable to convert raid-0 to raid-4
Product: Red Hat Enterprise Linux 6 Reporter: Roman <rommer>
Component: mdadmAssignee: Jes Sorensen <Jes.Sorensen>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: vgriit
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-06 13:20:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Roman 2011-11-11 15:41:17 UTC
Description of problem:
Unable to convert raid-0 to raid-4:

Version-Release number of selected component (if applicable):
mdadm-3.2.2-1.el6_1.2.x86_64
mdadm-3.2.2-6.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create test devices
# truncate -s 100M d1
# truncate -s 100M d2
# truncate -s 100M d3
# truncate -s 100M d4
# losetup /dev/loop1 d1
# losetup /dev/loop2 d2
# losetup /dev/loop3 d3
# losetup /dev/loop4 d4

2. Create software raid-0
# mdadm -C /dev/md0 -l 0 -c 64 -e 1.1 -n 3 /dev/loop1 /dev/loop2 /dev/loop3
mdadm: array /dev/md0 started.

3. Convert md0 to raid-4:
# mdadm -G /dev/md0 -l 4
mdadm: level of /dev/md0 changed to raid4

Actual results:
# cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] [raid0] 
md0 : active raid4 loop3[2] loop2[1] loop1[0]
      0 blocks super 1.1 level 4, 64k chunk, algorithm 5 [4/3] [UUU_]
      
unused devices: <none>

Expected results:
# cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] [raid0] 
md0 : active raid4 loop3[2] loop2[1] loop1[0]
      307008 blocks super 1.1 level 4, 64k chunk, algorithm 5 [4/3] [UUU_]
      
unused devices: <none>

Additional info:
Workaround - specify device size when creating raid-0
# mdadm -C /dev/md0 -l 0 -c 64 -z 102336 -e 1.1 -n 3 /dev/loop1 /dev/loop2 /dev/loop3

Comment 2 RHEL Program Management 2011-11-15 06:47:19 UTC
Since RHEL 6.2 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 3 Jes Sorensen 2012-01-27 13:35:27 UTC
Roman,

Does this happen when you try this on real disk and not just with loop
devices?

What kernel version are you running?

Thanks,
Jes

Comment 4 Roman 2012-01-27 14:16:33 UTC
Of course, I discovered bug using read devices.

Comment 5 Jes Sorensen 2012-01-27 15:06:09 UTC
and what kernel version are you seeing it with?

Comment 6 Roman 2012-01-27 15:14:42 UTC
2.6.32-131.21.1.el6.x86_64

Comment 7 Jes Sorensen 2012-02-06 13:20:08 UTC
Ok, I tried reproducing it using your details here, and I do not see
the problem you are reporting.

*However* you are not running 6.2, as 6.2 ships with mdadm-3.2.2-9,
whereas mdadm-3.2.2-6 was in the Alpha release.

Since this no longer seems to be an issue, I am going to close this
bug. If you can reproduce it on a clean 6.2 install, please report
back.

Thanks,
Jes

[root@monkeybay mnt]# truncate -s 100M d1
[root@monkeybay mnt]# truncate -s 100M d2
[root@monkeybay mnt]# truncate -s 100M d3
[root@monkeybay mnt]# losetup /dev/loop1 d1
[root@monkeybay mnt]# losetup /dev/loop2 d2
[root@monkeybay mnt]# losetup /dev/loop3 d3
[root@monkeybay mnt]# mdadm -C /dev/md0 -l 0 -c 64 -e 1.1 -n 3 /dev/loop1 /dev/loop2 /dev/loop3
mdadm: array /dev/md0 started.
[root@monkeybay mnt]# mdadm -G /dev/md0 -l 4
mdadm: level of /dev/md0 changed to raid4
[root@monkeybay mnt]# cat /proc/mdstat 
Personalities : [raid1] [raid6] [raid5] [raid4] [raid10] [raid0] 
md0 : active raid4 loop3[2] loop2[1] loop1[0]
      304128 blocks super 1.1 level 4, 64k chunk, algorithm 5 [4/3] [UUU_]
      
md124 : active (auto-read-only) raid10 sdc2[1] sdb2[2] sdd2[3] sda2[0]
      39063424 blocks 64K chunks 2 near-copies [4/4] [UUUU]
      
md125 : active (auto-read-only) raid5 sdb4[1] sdc4[2] sdd4[4] sda4[0]
      58590720 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      
md126 : active (auto-read-only) raid1 sda3[0] sdb3[1]
      19529656 blocks super 1.2 [2/2] [UU]
      
md127 : active (auto-read-only) raid10 sdc1[2] sda1[0] sdd1[3] sdb1[1]
      39053184 blocks 64K chunks 2 near-copies [4/4] [UUUU]
      
unused devices: <none>
[root@monkeybay mnt]# uname -a
Linux monkeybay 2.6.32-221.el6.x86_64 #1 SMP Tue Nov 15 14:50:38 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@monkeybay mnt]# rpm -q mdadm
mdadm-3.2.2-9.el6.x86_64

Comment 8 vgriit 2012-07-21 15:54:50 UTC
Hi

This issue is seen with loop device with varible size.

I tried with two device size have same size and another one having variable size

I got the following message

[root@rajan rsync-3.0.9]# mdadm -G /dev/md81 -l 4
mdadm: /dev/md81: could not set level to raid4

(In reply to comment #7)
> Ok, I tried reproducing it using your details here, and I do not see
> the problem you are reporting.
> 
> *However* you are not running 6.2, as 6.2 ships with mdadm-3.2.2-9,
> whereas mdadm-3.2.2-6 was in the Alpha release.
> 
> Since this no longer seems to be an issue, I am going to close this
> bug. If you can reproduce it on a clean 6.2 install, please report
> back.
> 
> Thanks,
> Jes
> 
> [root@monkeybay mnt]# truncate -s 100M d1
> [root@monkeybay mnt]# truncate -s 100M d2
> [root@monkeybay mnt]# truncate -s 100M d3
> [root@monkeybay mnt]# losetup /dev/loop1 d1
> [root@monkeybay mnt]# losetup /dev/loop2 d2
> [root@monkeybay mnt]# losetup /dev/loop3 d3
> [root@monkeybay mnt]# mdadm -C /dev/md0 -l 0 -c 64 -e 1.1 -n 3 /dev/loop1
> /dev/loop2 /dev/loop3
> mdadm: array /dev/md0 started.
> [root@monkeybay mnt]# mdadm -G /dev/md0 -l 4
> mdadm: level of /dev/md0 changed to raid4
> [root@monkeybay mnt]# cat /proc/mdstat 
> Personalities : [raid1] [raid6] [raid5] [raid4] [raid10] [raid0] 
> md0 : active raid4 loop3[2] loop2[1] loop1[0]
>       304128 blocks super 1.1 level 4, 64k chunk, algorithm 5 [4/3] [UUU_]
>       
> md124 : active (auto-read-only) raid10 sdc2[1] sdb2[2] sdd2[3] sda2[0]
>       39063424 blocks 64K chunks 2 near-copies [4/4] [UUUU]
>       
> md125 : active (auto-read-only) raid5 sdb4[1] sdc4[2] sdd4[4] sda4[0]
>       58590720 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
>       
> md126 : active (auto-read-only) raid1 sda3[0] sdb3[1]
>       19529656 blocks super 1.2 [2/2] [UU]
>       
> md127 : active (auto-read-only) raid10 sdc1[2] sda1[0] sdd1[3] sdb1[1]
>       39053184 blocks 64K chunks 2 near-copies [4/4] [UUUU]
>       
> unused devices: <none>
> [root@monkeybay mnt]# uname -a
> Linux monkeybay 2.6.32-221.el6.x86_64 #1 SMP Tue Nov 15 14:50:38 EST 2011
> x86_64 x86_64 x86_64 GNU/Linux
> [root@monkeybay mnt]# rpm -q mdadm
> mdadm-3.2.2-9.el6.x86_64