Re: Why mdadm --monitor --program sometimes only gives 2 command-line arguments to the program?

2008-01-06 Thread Nagilum

- Message from [EMAIL PROTECTED] -
Date: Sat, 5 Jan 2008 18:11:38 -0800 (PST)
From: Hxsrmeng [EMAIL PROTECTED]


I hope the mdadm monitor function can pass all three command-line
arguments to my-script, including the name of the event, the name of the
md device and the name of a related device if relevant.

But my-script doesn't get the third one, which should be /dev/sda2. Is
this not relevant?

If I really need to know it's /dev/sda2 that fails, what can I do?


Since you have the array name (e.g. /dev/md1) you could run mdadm -Q  
--detail /dev/md1 and parse the output or have a look at /proc/mdstat  
or /sys/block/md1/* .

Kind regards,
Alex.



#_  __  _ __ http://www.nagilum.org/ \n icq://69646724 #
#   / |/ /__  _(_) /_  _  [EMAIL PROTECTED] \n +491776461165 #
#  // _ `/ _ `/ / / // /  ' \  Amiga (68k/PPC): AOS/NetBSD/Linux   #
# /_/|_/\_,_/\_, /_/_/\_,_/_/_/_/   Mac (PPC): MacOS-X / NetBSD /Linux #
#   /___/ x86: FreeBSD/Linux/Solaris/Win2k  ARM9: EPOC EV6 #




cakebox.homeunix.net - all the machine one needs..



pgpBy8N97tUkA.pgp
Description: PGP Digital Signature


Re: Raid 1, can't get the second disk added back in.

2008-01-06 Thread Jim

Nagilum wrote:



Since /dev/hdb5 has been part of this array before you should use 
--re-add instead of --add.

Kind regards,
Alex.


OK

[EMAIL PROTECTED]:~# mdadm  /dev/md0 --re-add /dev/hdb5
mdadm: Cannot open /dev/hdb5: Device or resource busy

Jim
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Raid 1, can't get the second disk added back in.

2008-01-06 Thread Nagilum

- Message from [EMAIL PROTECTED] -
Date: Sun, 06 Jan 2008 06:13:06 -0500
From: Jim [EMAIL PROTECTED]


[EMAIL PROTECTED]:~# mdadm  /dev/md0 --re-add /dev/hdb5
mdadm: Cannot open /dev/hdb5: Device or resource busy


Have you tried stopping (-S) /dev/md0 and then re-assemble the array (-A)?



#_  __  _ __ http://www.nagilum.org/ \n icq://69646724 #
#   / |/ /__  _(_) /_  _  [EMAIL PROTECTED] \n +491776461165 #
#  // _ `/ _ `/ / / // /  ' \  Amiga (68k/PPC): AOS/NetBSD/Linux   #
# /_/|_/\_,_/\_, /_/_/\_,_/_/_/_/   Mac (PPC): MacOS-X / NetBSD /Linux #
#   /___/ x86: FreeBSD/Linux/Solaris/Win2k  ARM9: EPOC EV6 #




cakebox.homeunix.net - all the machine one needs..



pgpRdoUuWn4nt.pgp
Description: PGP Digital Signature


Re: Raid 1, can't get the second disk added back in.

2008-01-06 Thread Jim

Nagilum wrote:

- Message from [EMAIL PROTECTED] -
Date: Sun, 06 Jan 2008 06:13:06 -0500
From: Jim [EMAIL PROTECTED]


[EMAIL PROTECTED]:~# mdadm  /dev/md0 --re-add /dev/hdb5
mdadm: Cannot open /dev/hdb5: Device or resource busy


Have you tried stopping (-S) /dev/md0 and then re-assemble the array 
(-A)?
Yes, I did that yesterday.  Something is holding on to /dev/hdb5, 'cause 
I got the device busy message from that attempt too.  I think I'm going 
to remove the partition and see what happens.


Thanks,
Jim.
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PROBLEM: RAID5 reshape data corruption

2008-01-06 Thread Nagilum

- Message from [EMAIL PROTECTED] -
Date: Sun, 06 Jan 2008 00:31:46 +0100
From: Nagilum [EMAIL PROTECTED]


At the moment I'm thinking about writing a small perl program that
will generate me a shell script or makefile containing dd commands
that will copy the chunks from the drive to /dev/md0. I don't care if
that will be dog slow as long as I get most of my data back. (I'd
probably go forward instead of backward to take advantage of the
readahead, after I've determined the exact start chunk.)
For that I need to know one more thing.
Used Dev Size is 488308672k for md0 as well as the disk, 16k chunk size.
488308672/16 = 30519292.00
so the first dd would look like:
 dd if=/dev/sdg of=/dev/md0 bs=16k count=1 skip=30519291 seek=X

The big question now being how to calculate X.
Since I have a working testcase I can do a lot of testing before
touching the real thing. The formula to get X will probably contain a
5 for the 5(+1) devices the raid spans now, a 4 for the 4(+1) devices
the raid spanned before the reshape, a 3 for the device number of the
disk that failed and of course the skip/current chunk number.
Can you help me come up with it?
Thanks again for looking into the whole issue.

- End message from [EMAIL PROTECTED] -

Ok, the spare time over the weekend allowed me to make some headway.
I'm not sure if the attachment will make it through to the ML so I  
uploaded the perl script to: http://www.nagilum.de/md/rdrep.pl
First tests show already promising results although I seem to miss the  
start of the error corruption. Anyway unlike with the testcase at the  
real array I have to start after the area that is unreadable. I have  
already determined that last Friday.

Anyway I would appreciate it if someone could have a look over the script.
I'll probably change it a little bit and make every other dd run via  
exec instead of system to use some parallelism. (I guess the overhead  
for runnung dd will take about as much time as the transfer itself)

Thanks again,
Alex


#_  __  _ __ http://www.nagilum.org/ \n icq://69646724 #
#   / |/ /__  _(_) /_  _  [EMAIL PROTECTED] \n +491776461165 #
#  // _ `/ _ `/ / / // /  ' \  Amiga (68k/PPC): AOS/NetBSD/Linux   #
# /_/|_/\_,_/\_, /_/_/\_,_/_/_/_/   Mac (PPC): MacOS-X / NetBSD /Linux #
#   /___/ x86: FreeBSD/Linux/Solaris/Win2k  ARM9: EPOC EV6 #




cakebox.homeunix.net - all the machine one needs..



rdrep.pl
Description: Perl program


pgpqtVehc384R.pgp
Description: PGP Digital Signature


Re: Raid 1, can't get the second disk added back in.

2008-01-06 Thread Neil Brown
On Saturday January 5, [EMAIL PROTECTED] wrote:
 
 Since /dev/hdb5 has been part of this array before you should use  
 --re-add instead of --add.
 Kind regards,
 Alex.

That is not correct.

--re-add is only needed for arrays without metadata, for which you use
--build to start them.

NeilBrown
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Raid 1, can't get the second disk added back in.

2008-01-06 Thread Neil Brown
On Saturday January 5, [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED]:~# mdadm /dev/md0 --add /dev/hdb5
 mdadm: Cannot open /dev/hdb5: Device or resource busy
 
 All the solutions I've been able to google fail with the busy.  There is 
 nothing that I can find that might be  using /dev/hdb5 except the raid 
 device and it appears it's not either.

Very odd. But something must be using it.

What does
   ls -l /sys/block/hdb/hdb5/holders
show?
What about
   cat /proc/mounts
   cat /proc/swaps
   lsof /dev/hdb5
  
??
NeilBrown
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html