On Wed, 22 Aug 2012 09:14:15 +0200 Sergiusz Brzeziński <Sergiusz.Brzezinski@xxxxxxxxxxxxxx> wrote: > W dniu 21.08.2012 14:39, Adam Goryachev pisze: > > On 21/08/12 21:51, Sergiusz Brzeziński wrote: > >> > >> > >> W dniu 21.08.2012 12:44, David Brown pisze: > >>> On 21/08/2012 12:41, Sergiusz Brzeziński wrote: > >>>> Hi, > >>>> > >>>> I use Raid1 to make backup of the whole system. > >>> > >>> Raid is not a backup system. It is to improve uptimes, minimise > >>> downtimes due to > >>> disk failures, and possibly to improve disk speed and/or capacity. > >>> > >>> I would recommend you first think about what you are trying to > >>> achieve here - > >>> what are you trying to back up, how do you see restores being used, how > >>> efficiently are you using your hardware, your bandwidth, your time > >>> and effort? > >>> > >>> You would probably be better off with a normal fixed 2-disk raid1 to > >>> minimise > >>> the problems caused by a single disk failure, combined with an rsync > >>> snapshot > >>> style backup that can be fully automated and give quick and easy > >>> recovery of > >>> multiple old versions of files in the face of the most common cause > >>> of data loss > >>> - human error. > >> [...] > >> > >> I know, I know. Raid is not a backup system :) > > Aside from RAID is not a backup, perhaps the more useful suggestion > > would be to use the right tool for the job... > > > > So, again, ignoring that you possibly should not be using RAID for a > > backup... how about using udev scripts to see when you plugin a drive, > > and that script can check the UUID against any md arrays, and if it > > matches, add it to the array.... > > I wrote a script making this work. It runs once a hour. I pass the parameter > with md device to the script. It checks the state of the array with "mdadm > --detail". If there is something wrong (State : degraded) it reads UUID of that > array. Then it scans for /dev/sd* partitions and checks with "mdadm --examine" > if UUID matches. If so, the partition can be added with "mdadm --add". That is > why I asked abut this feature in mdadm - recognising if there is a new partition > belonging to monitored array. With mdadm this procedure would work on elegant > manner. > udev really is the right way to do this. Just get udev to run mdadm -I /dev/newdev whenever a device is discovered. It can then be automatically re-added depending on the policy set up in mdadm.conf. "mdadm --monitor" will not gain this functionality. It is for monitoring active arrays, not for monitor new devices. NeilBrown
Attachment:
signature.asc
Description: PGP signature