Danny Rawlins | 1 Oct 05:38 2011
Picon

Re: Safely swapping a disk in a RAID456

John Robinson wrote:
> On 30/09/2011 16:42, martin f krafft wrote:
>> Dear list,
>>
>> I would like to swap out a drive in a RAID6 (4 drives), but ideally
>> without letting the RAID degrade. I was thinking that it should be
>> possible to declare the new disc a copy of the old one, let it sync,
>> then remove the old one and let the new one take over, but MD does
>> not seem to support that.
>
> Not yet, but it's in the roadmap as a hot-replace. In the mean time,
> you can do something very similar by hand with almost no lost of
> redundancy, if your RAID456 has a bitmap.
>
>> Next, I thought that I could add the new disc as a spare, grow the
>> array to 5 discs, and somehow shrink it back to 4 again, but of
>> course that does not work either, since 4→5 is a reshape, and there
>> seems to be no way to control which disc to remove from the RAID6 on
>> a shrink (making it a spare), without degrading the array in the
>> process.
>
> Doing a shrink while specifying which drive to remove is also on the
> roadmap, I believe. But doing huge reshapes like this are not the way
> forward for a hot-replace.
>
>> Does anyone have any ideas? This should not be so hard…
>
> I'd be glad to hear of any "real" RAID card that made it easier, or
> even possible.
>
(Continue reading)

Asdo | 1 Oct 12:32 2011

Re: Safely swapping a disk in a RAID456

On 09/30/11 20:02, John Robinson wrote:
>
> Not yet, but it's in the roadmap as a hot-replace. In the mean time, 
> you can do something very similar by hand with almost no lost of 
> redundancy, if your RAID456 has a bitmap.
> ...
>
> I'd be glad to hear of any "real" RAID card that made it easier, or 
> even possible.
>
> Something along the lines of:
>
> # briefly remove your disc from the array
> mdadm --manage /dev/md_raid456 --remove /dev/the_disc_i_want_to_remove
> # make a temp raid1 with only the one disc, using build so metadata is
> # only in RAM and nothing is written to the disc
> mdadm --build /dev/md_temp_raid1 --level 1 
> /dev/the_disc_i_want_to_remove missing
> # now re-add something which looks identical to your original disc,
> # but is actually a single-sided mirror, back into the array
> # the above can all be done very quickly so your raid456 only runs
> # without a drive for seconds
> mdadm --manage /dev/md_raid456 --re-add /dev/md_temp_raid1
> # now get md to make a mirror (copy) to the new disc
> mdadm --manage /dev/md_temp_raid1 --add /dev/the_new_disc
> # wait for it to finish, or just wait for it yourself
> mdadm --wait /dev/md_temp_raid1
> # and switch back again: remove the temporary raid1
> mdadm --manage /dev/md_raid456 --remove /dev/md_temp_raid1
> # stop it so the new disc becomes available again
(Continue reading)

David Brown | 1 Oct 16:53 2011
Picon

Re: Safely swapping a disk in a RAID456

On 30/09/11 18:28, Andre Noll wrote:
> On Fri, Sep 30, 17:42, martin f krafft wrote:
>> Does anyone have any ideas?
>
> Create a 2-disk Raid1 (with external metadata) containing the disk
> you'd like to replace and the replacement disk.
>
> And yes, it would be great if md provided an easier way to do this.
>

That would be "hot replace", which is quite high up on the md/mdadm 
"things to do" list.

<http://neil.brown.name/blog/20110216044002#2>

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

Andre Noll | 1 Oct 17:51 2011

Re: Safely swapping a disk in a RAID456

On Sat, Oct 01, 16:53, David Brown wrote:
> On 30/09/11 18:28, Andre Noll wrote:
> >On Fri, Sep 30, 17:42, martin f krafft wrote:
> >>Does anyone have any ideas?
> >
> >Create a 2-disk Raid1 (with external metadata) containing the disk
> >you'd like to replace and the replacement disk.
> >
> >And yes, it would be great if md provided an easier way to do this.
> >
> 
> That would be "hot replace", which is quite high up on the md/mdadm
> "things to do" list.
> 
> <http://neil.brown.name/blog/20110216044002#2>

Thanks for the pointer. I wonder if it would be useful to have an
md-aware dd command which could read from an md device and output
only the contents of one component. I.e. it would give the same result
as dd if=/dev/component-device of=/dev/new-disk if there are no read
errors but would redirect failed reads to the working devices.

This should be easy to implement as it avoids the complexity mentioned
in Neil's blog posting. Moreover, it could be written purely in user
space and would work on any kernel version.  The price to pay is of
course that the array needs to be r/o during the operation.

Andre
--

-- 
The only person who always got his work done by Friday was Robinson Crusoe
(Continue reading)

Aapo Laine | 2 Oct 01:21 2011

Re: potentially lost largeish raid5 array..

Excuse the late reply

On 09/25/11 12:10, NeilBrown wrote:
> On Sat, 24 Sep 2011 23:57:58 +0200 Aapo Laine<aapo.laine <at> shiftmail.org>
> wrote:
> Hopefully not too shocking...  I'm not planning on leaving md any time soon.
> I do still enjoy working on it.
> But it certainly isn't as fresh and new as it was 10 years again.  It would
> probably do both me and md a lot of good to have someone with new enthusiasm
> and new perspectives...

I understand

> ....
> That is certainly true, but seems to be true across much of the kernel, and
> probably most code in general (though I'm sure such a comment will lead to
> people wanting to tell me their favourite exceptions ... so I'll start with
> "TeX").
>
> This is one of the reasons I offered "mentoring" to any likely candidate.
>
>
>
>> - there is not much explanation of overall strategies, or the structure
>> of code. Also the flow of data between the functions is not much
>> explained most of the times.
>>
>> - It's not obvious to me what is the entry point for kernel processes
>> related to MD arrays, how are they triggered and where do they run...
>> E.g. in the past I tried to understand how did resync work, but I
(Continue reading)

Marcin M. Jessa | 2 Oct 12:05 2011

Linux raid autodetect partition disappears after RAID degrade


Hi guys.

My RAID array just kicked out one of the drives again at heavy activity
running:
  # ddrescue -n -f /dev/fridge/storage storage.img ddrescue.log
where the /dev/fridge/storage LV Size is 4.88 TiB

What's strange is the device is there:
   brw-rw---- 1 root disk 8, 144 Oct  2 11:48 /dev/sdj

But the /dev/sdj1 which should hold Linux raid autodetect partition just 
disappeared...

  # fdisk -l /dev/sdj

Disk /dev/sdj: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/sdj1              63  3907029167  1953514552+  fd  Linux raid 
autodetect

Is this a normal behavior? I don't understand either why the heck is the 
RAID degrading all the time ?
I replaced all the cables with SATA3 cables, the BIOS is updated, both 
(Continue reading)

Dominique | 2 Oct 16:24 2011
Picon

Re: mdadm - level change from raid 1 to raid 5

Hi Neil,

Thanks for the Info, I'll try a new series of VM tomorrow.

I do have a question though. I thought that RAID5 required 3 HDD not 2. 
Hence I am a bit puzzled by your last comment....
"Nope. This is because md won't change a 5-device RAID1 to RAID5. It 
will only change a 2-device RAID1 to RAID5. This is trivial to do 
because a 2-device RAID1 and a 2-device RAID5 have data in exactly the 
same places. " Or do I grow to a 3HDD RAID5 config with a 'missing' HDD.

I understand the 2HDD to 5HDD growth, but not how to make the other one. 
Since I cant test it right know, I'll both tomorrow.

Dom

On 01/10/2011 00:02, NeilBrown wrote:
> On Fri, 30 Sep 2011 20:31:37 +0200 Dominique<dcouot <at> hotmail.com>  wrote:
>
>> Hi,
>>
>> Using Ubuntu 11.10 server , I am testing RAID level changes through
>> MDADM. The objective is to migrate RAID 1 (1+ HDD) environment to RAID 5
>> (3+ HDD) without data loss.
>> In order to make as simple as possible, I started in a VM environment
>> (Virtual Box).
> Very sensible!!
>
>
>> Initial Setup:
(Continue reading)

Aapo Laine | 2 Oct 19:00 2011

Re: potentially lost largeish raid5 array..

On 10/02/11 01:21, Aapo Laine wrote:
> Actually we could even open a new mailing list or maybe there is 
> something better in web 2.0, like a wiki, for these MD code 
> explanations. Explanations in a wiki can be longer, there can be user 
> discussions, and such lines of comments do not need to be pushed as 
> far as Linus.

Sorry, I wrote this before reading other replies. Kristleifur already 
proposed what might be optimal, that is, GitHub

> I think concentrating all code explanation requests, discussions, 
> and/or at least the answers, onto something like a wiki could prevent 
> double-questions. Unfortunately I know nothing about wikis or other 
> web 2.0 technologies. Maybe someone in this ML can suggest a solution?

Ditto

+1 on the github
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Marcin M. Jessa | 2 Oct 19:13 2011

Re: Linux raid autodetect partition disappears after RAID degrade

On 10/02/2011 12:05 PM, Marcin M. Jessa wrote:
>
> Hi guys.
>
> My RAID array just kicked out one of the drives again at heavy activity
> running:
>  # ddrescue -n -f /dev/fridge/storage storage.img ddrescue.log
> where the /dev/fridge/storage LV Size is 4.88 TiB
>
> What's strange is the device is there:
>   brw-rw---- 1 root disk 8, 144 Oct  2 11:48 /dev/sdj
>
> But the /dev/sdj1 which should hold Linux raid autodetect partition
> just disappeared...
>
>  # fdisk -l /dev/sdj
>
> Disk /dev/sdj: 2000.4 GB, 2000398934016 bytes
> 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0x00000000
>
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sdj1              63  3907029167  1953514552+  fd  Linux raid
> autodetect
>
>
> Is this a normal behavior? I don't understand either why the heck is
(Continue reading)

Thomas Jarosch | 2 Oct 21:45 2011

[mdadm PATCH] Fix small memory leak

Credit goes to cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch <at> intra2net.com>
---
 policy.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/policy.c b/policy.c
index 2bbbac8..4a6ef82 100644
--- a/policy.c
+++ b/policy.c
 <at>  <at>  -757,8 +757,10  <at>  <at>  int policy_check_path(struct mdinfo *disk, struct map_ent *array)

 	snprintf(path, PATH_MAX, FAILED_SLOTS_DIR "/%s", id_path);
 	f = fopen(path, "r");
-	if (!f)
+	if (!f) {
+		free(id_path);
 		return 0;
+	}

 	rv = fscanf(f, " %s %x:%x:%x:%x\n",
 		    array->metadata,
 <at>  <at>  -767,6 +769,7  <at>  <at>  int policy_check_path(struct mdinfo *disk, struct map_ent *array)
 		    array->uuid+2,
 		    array->uuid+3);
 	fclose(f);
+	free(id_path);
 	return rv == 5;
 }
(Continue reading)


Gmane