0

I backup my raid50 with mdadm --detail --scan --verbose >> /etc/mdadm.conf. Output of mdadm --detail --scan --verbose is:

ARRAY /dev/md1 level=raid5 num-devices=3 metadata=1.2 name=1 UUID=0269ced6:2ea00588:fee3c926:173518f9
   devices=/dev/vdb1,/dev/vdc1,/dev/vdh1
ARRAY /dev/md2 level=raid5 num-devices=3 metadata=1.2 name=2 UUID=fecf771f:f9ec31be:be0e96dd:74936cd0
   devices=/dev/vde1,/dev/vdf1,/dev/vdg1
ARRAY /dev/md0 level=raid0 num-devices=2 metadata=1.2 name=0 UUID=c1918082:23d519a0:805e7dd9:ba2c093b
   devices=/dev/md1,/dev/md2

After reboot, my raid did not assembly correctly but according to man mdadm the location of file is ok:

Default is to use /etc/mdadm.conf and /etc/mdadm.conf.d, or if those are missing then /etc/mdadm/mdadm.conf and /etc/mdadm/mdadm.conf.d.

ARRAY /dev/md1 level=raid5 num-devices=3 metadata=1.2 name=1 UUID=0269ced6:2ea00588:fee3c926:173518f9
   devices=/dev/vdb1,/dev/vdc1,/dev/vdh1
ARRAY /dev/md/2_0 level=raid5 num-devices=3 metadata=1.2 name=2 UUID=fecf771f:f9ec31be:be0e96dd:74936cd0
   devices=/dev/vde1,/dev/vdf1,/dev/vdg1
INACTIVE-ARRAY /dev/md126 num-devices=1 metadata=1.2 name=3 UUID=f7aed543:c3284946:28c83d49:ce946402
   devices=/dev/vdi1
ARRAY /dev/md/0_0 level=raid0 num-devices=2 metadata=1.2 name=0 UUID=c1918082:23d519a0:805e7dd9:ba2c093b
   devices=/dev/md/2_0,/dev/md1

I am able to assemble disks with mdadm --assembly command.

Questions:
1. Why mdadm did not assamble it correctly? How should I backup configuration to automate this process after reboot?
2. Does mdadm assemble raid by device neme /dev/vdX1 or by UUID(of disk or array UUID)? I am asking because if my disk will fail, I will replace it and after reboot system could change the name /dev/vdX.

  • For mdadm.conf, you really only need ARRAY /dev/mdX UUID=a:b:c:d. Adding any more conditions may result in assembly problems (device names change, host names may not match, etc.) – frostschutz May 7 '18 at 15:39
  • I read that configuration file should be crated by mdadm --detail --scan --verbose. Now, I left only lines ARRAY /dev/mdX UUID=a:b:c:d but the problem persist. Any other ideas? – dorinand May 7 '18 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.