mdadm: ARRAY <ignore> lines not correctly handled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the mdadm.conf man page states:
The ARRAY lines identify actual arrays.  The second word on the line may be 
the name of the device where the array is normally assembled, [...].  
Alternately the word <ignore> (complete with angle brackets) can be given in 
which case any array which matches the rest of the line will never be 
automatically assembled.

so let's say i have a raid that looks like:
/dev/md0:
        Version : 1.2
  Creation Time : Wed Oct 31 16:05:49 2012
     Raid Level : raid6
     Array Size : 1953522688 (1863.02 GiB 2000.41 GB)
  Used Dev Size : 976761344 (931.51 GiB 1000.20 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Sun Nov 11 03:35:26 2012
          State : clean 
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : vapier:0  (local to host vapier)
           UUID : 51b812dc:094ea54b:f8f7b331:9982b16c
         Events : 112048

    Number   Major   Minor   RaidDevice State
       0       8       32        0      active sync   /dev/sdc
       1       8        0        1      active sync   /dev/sda
       4       8       16        2      active sync   /dev/sdb
       5       8       64        3      active sync   /dev/sde

the man page says i should be able to prevent this from being auto-assembled 
via `mdamd -As` by doing something like:
ARRAY <ignore> uuid=51b812dc:094ea54b:f8f7b331:9982b16c

or perhaps:
DEVICE /dev/sd[abce]
ARRAY <ignore> devices=/dev/sda,/dev/sdb,/dev/sde,/dev/sdc

unfortunately, this turns out to not be the case.  mdadm goes ahead and auto-
assembles things anyways.  looking at the code, it seems that it's due to the 
code falling back if nothing was detected:
mdadm.c
...
    do {
        failures = 0;
        successes = 0;
        rv = 0;
        for (a = array_list; a ; a = a->next) {
            int r;
            if (a->assembled)
                continue;
            if (a->devname &&   
                strcasecmp(a->devname, "<ignore>") == 0)
                continue;

            r = Assemble(ss, a->devname,
                     a, NULL, c);
            if (r == 0) {
                a->assembled = 1;
                successes++;
            } else
                failures++;
            rv |= r;
            cnt++;
        }
    } while (failures && successes);
    if (c->homehost && cnt == 0) {
        /* Maybe we can auto-assemble something.
         * Repeatedly call Assemble in auto-assemble mode
         * until it fails
         */
        int rv2;
        int acnt;
        ident->autof = c->autof;
        do {
            struct mddev_dev *devlist = conf_get_devs();
            acnt = 0;
            do {
                rv2 = Assemble(ss, NULL,
                           ident,
                           devlist, c);
...

the idea is to be able to have a system with multiple raids (some of which are 
dormant/backups), blacklist the ones that you want to keep idle, and bring 
online all the rest.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux