linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mdadm --grow on raid1 returns nonzero
@ 2011-10-12 23:27 Kevin W Monroe
  0 siblings, 0 replies; only message in thread
From: Kevin W Monroe @ 2011-10-12 23:27 UTC (permalink / raw)
  To: linux-raid

Hi folks,

I'm trying to grow a raid1 array of 2 loop devices as a test. I created 
the array and successfully grew it, but mdadm --grow exits with a 
non-zero return code (1). I see the following in Grow.c's analyse_change():

if (info->new_level == 1) {
     if (info->delta_disks == UnSet)
         /* Don't know what to do */
         return "no change requested for Growing RAID1";
     re->level = 1;
     re->backup_blocks = 0;
     re->parity = 0;
     return NULL;
}

So my situation happens because info->delta_disks is UnSet. Is growing a 
raid1 array on the same underlying devices not a valid use case? Here's 
my setup/results:

[root@test-lpar01 ~]# mdadm --version
mdadm - v3.2.1 - 28th March 2011

[root@test-lpar01 ~]# dd if=/dev/zero of=1 bs=1024 count=10000
10000+0 records in
10000+0 records out
10240000 bytes (10 MB) copied, 0.341808 s, 30.0 MB/s
[root@test-lpar01 ~]# dd if=/dev/zero of=2 bs=1024 count=10000
10000+0 records in
10000+0 records out
10240000 bytes (10 MB) copied, 0.351076 s, 29.2 MB/s

[root@test-lpar01 ~]# losetup --show -f 1
/dev/loop0
[root@test-lpar01 ~]# losetup --show -f 2
/dev/loop1

[root@test-lpar01 ~]# mdadm -Cv /dev/md0 -l1 -n2 -z 5000 /dev/loop0 
/dev/loop1
mdadm: Note: this array has metadata at the start and
     may not be suitable as a boot device.  If you plan to
     store '/boot' on this device please ensure that
     your boot-loader understands md/v1.x metadata, or use
     --metadata=0.90
mdadm: largest drive (/dev/loop0) exceeds size (5000K) by more than 1%
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.

[root@test-lpar01 ~]# cat /proc/mdstat
Personalities : [raid0] [raid1]
md0 : active raid1 loop1[1] loop0[0]
       5000 blocks super 1.2 [2/2] [UU]

unused devices: <none>

[root@test-lpar01 ~]# mdadm --grow -z 7500 /dev/md0
mdadm: component size of /dev/md0 has been set to 7500K
mdadm: no change requested for Growing RAID1

[root@test-lpar01 ~]# echo $?
1

[root@test-lpar01 ~]# cat /proc/mdstat
Personalities : [raid0] [raid1]
md0 : active raid1 loop1[1] loop0[0]
       7500 blocks super 1.2 [2/2] [UU]

unused devices: <none>


You can see the array has grown, so I'm curious if the message "no 
change requested for Growing RAID1" from analyse_change should really be 
returned. Thanks,
-- 
Kevin Monroe


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-12 23:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-12 23:27 mdadm --grow on raid1 returns nonzero Kevin W Monroe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).