From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wilhelm Meier Subject: Re: mdadm and automatic re-add / incremental mode with usb-disk Date: Sun, 30 Nov 2008 14:52:17 +0100 Message-ID: <200811301452.17352.wilhelm.meier@fh-kl.de> References: <200811301231.58180.wilhelm.meier@fh-kl.de> <200811301403.29920.wilhelm.meier@fh-kl.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline Sender: linux-raid-owner@vger.kernel.org To: Justin Piszcz Cc: linux-raid@vger.kernel.org List-Id: linux-raid.ids Am Sonntag 30 November 2008 schrieb Justin Piszcz: > On Sun, 30 Nov 2008, Wilhelm Meier wrote: > > Am Sonntag 30 November 2008 schrieb Justin Piszcz: > >> On Sun, 30 Nov 2008, Wilhelm Meier wrote: > > > > That might be, but what is the difference between doing the > > re-add and re-sync on boot (that's what happens!) or if the drive > > comes back on a running system. > > From the docs, when you remove and re-add it would appear to be a > 'reocover' whereas an unclean shutdown would be resyncing (or > repair if you do not have a bitmap). > > linux-2.6.27.7/Documentation/md.txt (actually a good doc to read > btw) > > resync - redundancy is being recalculated after > unclean shutdown or creation > recover - a hot spare is being built to replace a > failed/missing device > repair - A full check and repair is happening. This > is similar to 'resync', but was requested by the user, and the > write-intent bitmap is NOT used to optimise the process. Oh yes, I mean "recover", thats what is happening after the manual re-add if I unplug und then replug the usb-disk. > > > mdadm can surely determine the state/uuid and do this - the same > > as on reboot. > > > >> When you have a failed drive and you re-attach it, it will stay > >> as a removed unit and you need to remove it and add it manually > >> as you stated. > > > > the only thing I have to do is e.g. > > > > mdadm --re-add /dev/md1000 /dev/sdg1 > > > > then it starts reconstructing the right way. > > > > So, my thought was to do this as part of a udev-rule. > > But I think this is a common case and therefore there should be a > > well-known solution > > Yeah I suppose you could do something like this. Is the purpose > more or less to have a portable raid1 array? Yes, exactly. I want to have a portable usb-raid of 2 disks (or 2x2 with lvm on top) and I want to plug and unplug the disks freely. -- Wilhelm