linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spare group
@ 2007-06-11 13:45 Tomka Gergely
  2007-06-11 23:47 ` Neil Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Tomka Gergely @ 2007-06-11 13:45 UTC (permalink / raw)
  To: Linux, Raid lista

Good day!

I have problems with spare-groups. The problem: spare groups dont work 
for me. How can i use ths function?

The test :

# mdadm26 -D /dev/md0
/dev/md0:
         Version : 01.02.03
   Creation Time : Mon Jun 11 15:25:23 2007
      Raid Level : raid5
      Array Size : 19534720 (18.63 GiB 20.00 GB)
   Used Dev Size : 19534720 (9.31 GiB 10.00 GB)
    Raid Devices : 3
   Total Devices : 3
Preferred Minor : 0
     Persistence : Superblock is persistent

     Update Time : Mon Jun 11 16:05:21 2007
           State : clean, degraded
  Active Devices : 2
Working Devices : 2
  Failed Devices : 1
   Spare Devices : 0

          Layout : left-symmetric
      Chunk Size : 64K

            Name : ursula:T1  (local to host ursula)
            UUID : 3e420024:281f9bb1:fd9ef39b:c18153b1
          Events : 10

     Number   Major   Minor   RaidDevice State
        0       0        0        0      removed
        1       8       17        1      active sync   /dev/sdb1
        3       8       33        2      active sync   /dev/sdc1

        0       8        1        -      faulty spare   /dev/sda1

# mdadm26 -D /dev/md1
/dev/md1:
         Version : 01.02.03
   Creation Time : Mon Jun 11 15:35:40 2007
      Raid Level : raid5
      Array Size : 19534720 (18.63 GiB 20.00 GB)
   Used Dev Size : 19534720 (9.31 GiB 10.00 GB)
    Raid Devices : 3
   Total Devices : 4
Preferred Minor : 1
     Persistence : Superblock is persistent

     Update Time : Mon Jun 11 15:38:23 2007
           State : clean
  Active Devices : 3
Working Devices : 4
  Failed Devices : 0
   Spare Devices : 1

          Layout : left-symmetric
      Chunk Size : 64K

            Name : ursula:T2  (local to host ursula)
            UUID : fb8ece28:9a6a31f8:700f37f6:7ee91bcf
          Events : 6

     Number   Major   Minor   RaidDevice State
        0       8       49        0      active sync   /dev/sdd1
        1       8       65        1      active sync   /dev/sde1
        3       8       81        2      active sync   /dev/sdf1

        4       8       97        -      spare   /dev/sdg1

# cat /etc/mdadm/mdadm.conf
DEVICE /dev/sd[a-g]1

HOMEHOST ursula

ARRAY /dev/md1 level=raid5 devices=/dev/sd[defg]1 num-devices=3 
spares=1 spare-group=ubul name=ursula:T2 
UUID=fb8ece28:9a6a31f8:700f37f6:7ee91bcf
ARRAY /dev/md0 level=raid5 devices=/dev/sd[abc]1 num-devices=3 
spare-group=ubul name=ursula:T1 UUID=3e420024:281f9bb1:fd9ef39b:c18153b1

According to the source:

* If an array has active < raid && spare == 0 && spare_group !=NULL
* Look for another array with spare > 0 and active == raid and same 
spare_group
* if found, choose a device and hotremove/hotadd

This is not happening. What is my mistake?

tg


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spare group
  2007-06-11 13:45 spare group Tomka Gergely
@ 2007-06-11 23:47 ` Neil Brown
  2007-06-12  6:34   ` Tomka Gergely
  0 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2007-06-11 23:47 UTC (permalink / raw)
  To: tomka; +Cc: Linux, Raid lista

On Monday June 11, tomka@avaxio.net wrote:
> 
> # cat /etc/mdadm/mdadm.conf
> DEVICE /dev/sd[a-g]1
> 
> HOMEHOST ursula
> 
> ARRAY /dev/md1 level=raid5 devices=/dev/sd[defg]1 num-devices=3 
> spares=1 spare-group=ubul name=ursula:T2 
> UUID=fb8ece28:9a6a31f8:700f37f6:7ee91bcf
> ARRAY /dev/md0 level=raid5 devices=/dev/sd[abc]1 num-devices=3 
> spare-group=ubul name=ursula:T1 UUID=3e420024:281f9bb1:fd9ef39b:c18153b1

You don't want the "devices=" entries in there.  If you leave them
there, and sdg1 does get moved to md0, then on the next restart, md0
won't get assembled properly.

> 
> According to the source:
> 
> * If an array has active < raid && spare == 0 && spare_group !=NULL
> * Look for another array with spare > 0 and active == raid and same 
> spare_group
> * if found, choose a device and hotremove/hotadd
> 
> This is not happening. What is my mistake?

Is "mdadm --monitor" running?  That is required to perform
spare-migration.

NeilBrown

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spare group
  2007-06-11 23:47 ` Neil Brown
@ 2007-06-12  6:34   ` Tomka Gergely
  2007-06-12  6:59     ` Neil Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Tomka Gergely @ 2007-06-12  6:34 UTC (permalink / raw)
  To: Neil Brown; +Cc: Linux, Raid lista

Neil Brown írta:
> On Monday June 11, tomka@avaxio.net wrote:
>> ARRAY /dev/md1 level=raid5 devices=/dev/sd[defg]1 num-devices=3 
>> spares=1 spare-group=ubul name=ursula:T2 
>> UUID=fb8ece28:9a6a31f8:700f37f6:7ee91bcf
>> ARRAY /dev/md0 level=raid5 devices=/dev/sd[abc]1 num-devices=3 
>> spare-group=ubul name=ursula:T1 UUID=3e420024:281f9bb1:fd9ef39b:c18153b1
> 
> You don't want the "devices=" entries in there.  If you leave them
> there, and sdg1 does get moved to md0, then on the next restart, md0
> won't get assembled properly.

Thanks.

>> According to the source:
>>
>> * If an array has active < raid && spare == 0 && spare_group !=NULL
>> * Look for another array with spare > 0 and active == raid and same 
>> spare_group
>> * if found, choose a device and hotremove/hotadd
>>
>> This is not happening. What is my mistake?
> 
> Is "mdadm --monitor" running?  That is required to perform
> spare-migration.

Yes, of course.

tg
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spare group
  2007-06-12  6:34   ` Tomka Gergely
@ 2007-06-12  6:59     ` Neil Brown
  2007-06-12  7:57       ` Tomka Gergely
  0 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2007-06-12  6:59 UTC (permalink / raw)
  To: tomka; +Cc: Linux, Raid lista

On Tuesday June 12, tomka@avaxio.net wrote:
> >> According to the source:
> >>
> >> * If an array has active < raid && spare == 0 && spare_group !=NULL
> >> * Look for another array with spare > 0 and active == raid and same 
> >> spare_group
> >> * if found, choose a device and hotremove/hotadd
> >>
> >> This is not happening. What is my mistake?
> > 
> > Is "mdadm --monitor" running?  That is required to perform
> > spare-migration.
> 
> Yes, of course.

Good - I need to get the obvious things out of the way first :-)

(reads code).

Ahhh. You are using version-1 superblocks aren't you?  That code only
works for version-0.90 superblocks.  That was careless of me.  It
shouldn't be hard to make it work more generally, but it looks like it
will be slightly more than trivial.  I'll try to get you a patch in
the next day or so (feel free to remind me if I seem to have
forgotten).

Thanks for testing and reporting this problem.

NeilBrown

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spare group
  2007-06-12  6:59     ` Neil Brown
@ 2007-06-12  7:57       ` Tomka Gergely
  2007-06-12  9:54         ` Neil Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Tomka Gergely @ 2007-06-12  7:57 UTC (permalink / raw)
  To: Neil Brown; +Cc: Linux, Raid lista

Neil Brown írta:
> (reads code).
> 
> Ahhh. You are using version-1 superblocks aren't you?  That code only
> works for version-0.90 superblocks.  That was careless of me.  It
> shouldn't be hard to make it work more generally, but it looks like it
> will be slightly more than trivial.  I'll try to get you a patch in
> the next day or so (feel free to remind me if I seem to have
> forgotten).
> 
> Thanks for testing and reporting this problem.
> 
> NeilBrown

# mdadm26 --detail /dev/md0
/dev/md0:
         Version : 00.90.03
   Creation Time : Tue Jun 12 10:31:08 2007
      Raid Level : raid5
      Array Size : 19534848 (18.63 GiB 20.00 GB)
   Used Dev Size : 9767424 (9.31 GiB 10.00 GB)
    Raid Devices : 3
   Total Devices : 4
Preferred Minor : 0
     Persistence : Superblock is persistent

     Update Time : Tue Jun 12 10:33:35 2007
           State : clean
  Active Devices : 3
Working Devices : 4
  Failed Devices : 0
   Spare Devices : 1

          Layout : left-symmetric
      Chunk Size : 64K

            UUID : 5fd83926:01739a55:36458d87:119f8994 (local to host 
ursula)
          Events : 0.4

     Number   Major   Minor   RaidDevice State
        0       8        1        0      active sync   /dev/sda1
        1       8       17        1      active sync   /dev/sdb1
        2       8       33        2      active sync   /dev/sdc1

        3       8       49        -      spare   /dev/sdd1

/dev/md1:
         Version : 00.90.03
   Creation Time : Tue Jun 12 10:31:29 2007
      Raid Level : raid5
      Array Size : 19534848 (18.63 GiB 20.00 GB)
   Used Dev Size : 9767424 (9.31 GiB 10.00 GB)
    Raid Devices : 3
   Total Devices : 3
Preferred Minor : 1
     Persistence : Superblock is persistent

     Update Time : Tue Jun 12 10:36:18 2007
           State : clean, degraded
  Active Devices : 2
Working Devices : 2
  Failed Devices : 1
   Spare Devices : 0

          Layout : left-symmetric
      Chunk Size : 64K

            UUID : 815d6fc4:a55c2602:36458d87:119f8994 (local to host 
ursula)
          Events : 0.6

     Number   Major   Minor   RaidDevice State
        0       8       65        0      active sync   /dev/sde1
        1       8       81        1      active sync   /dev/sdf1
        2       0        0        2      removed

        3       8       97        -      faulty spare   /dev/sdg1

ARRAY /dev/md1 level=raid5 num-devices=3 spare-group=ubul 
UUID=815d6fc4:a55c2602:36458d87:119f8994
ARRAY /dev/md0 level=raid5 num-devices=3 spares=1 spare-group=ubul 
UUID=5fd83926:01739a55:36458d87:119f8994

I am very sorry, but it wont works with .9 superblocks also :( We 
missing something small, but important here. Before you start to code. 
mdadm was running in monitor mode, and reported a Fail. mdadm is the 
latest version, 2.6.2.

tg
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spare group
  2007-06-12  7:57       ` Tomka Gergely
@ 2007-06-12  9:54         ` Neil Brown
  2007-06-13  7:25           ` Tomka Gergely
  0 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2007-06-12  9:54 UTC (permalink / raw)
  To: tomka; +Cc: Linux, Raid lista

On Tuesday June 12, tomka@avaxio.net wrote:
> 
> I am very sorry, but it wont works with .9 superblocks also :( We 
> missing something small, but important here. Before you start to code. 
> mdadm was running in monitor mode, and reported a Fail. mdadm is the 
> latest version, 2.6.2.
> 
> tg

Hmmm..... 
[tests code]

Yes, you are right.  It looks like a bug was introduced in 2.6 which
broke various aspects of --monitor.  I guess I need to add some
--monitor tests to my regression test suite.

This patch should fix it.

Thanks again,
NeilBrown


-------------------------------
Fix spare migration and other problems with --monitor.

2.6 broke --monitor in various ways, including spare migration
stopped working.  This fixes it.


### Diffstat output
 ./Monitor.c |    1 +
 1 file changed, 1 insertion(+)

diff .prev/Monitor.c ./Monitor.c
--- .prev/Monitor.c	2007-02-22 14:59:11.000000000 +1100
+++ ./Monitor.c	2007-06-12 19:48:34.000000000 +1000
@@ -328,6 +328,7 @@ int Monitor(mddev_dev_t devlist,
 			for (i=0; i<MaxDisks && i <= array.raid_disks + array.nr_disks;
 			     i++) {
 				mdu_disk_info_t disc;
+				disc.number = i;
 				if (ioctl(fd, GET_DISK_INFO, &disc) >= 0) {
 					info[i].state = disc.state;
 					info[i].major = disc.major;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: spare group
  2007-06-12  9:54         ` Neil Brown
@ 2007-06-13  7:25           ` Tomka Gergely
  0 siblings, 0 replies; 7+ messages in thread
From: Tomka Gergely @ 2007-06-13  7:25 UTC (permalink / raw)
  To: Neil Brown; +Cc: Linux, Raid lista

Neil Brown írta:
> On Tuesday June 12, tomka@avaxio.net wrote:
>> I am very sorry, but it wont works with .9 superblocks also :( We 
>> missing something small, but important here. Before you start to code. 
>> mdadm was running in monitor mode, and reported a Fail. mdadm is the 
>> latest version, 2.6.2.
>>
>> tg
> 
> Hmmm..... 
> [tests code]
> 
> Yes, you are right.  It looks like a bug was introduced in 2.6 which
> broke various aspects of --monitor.  I guess I need to add some
> --monitor tests to my regression test suite.
> 
> This patch should fix it.
> 
> Thanks again,
> NeilBrown

Thanks, the patch is working.

tg
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-06-13  7:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11 13:45 spare group Tomka Gergely
2007-06-11 23:47 ` Neil Brown
2007-06-12  6:34   ` Tomka Gergely
2007-06-12  6:59     ` Neil Brown
2007-06-12  7:57       ` Tomka Gergely
2007-06-12  9:54         ` Neil Brown
2007-06-13  7:25           ` Tomka Gergely

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).