No /etc/mdadm.conf in centos 6

16,100

That file isn't typically included in the mdadm package.

$ rpm -ql mdadm | grep "mdadm.conf"
/usr/share/doc/mdadm-2.6.9/mdadm.conf-example
/usr/share/man/man5/mdadm.conf.5.gz

You can either use the sample one included or generate it your self. My file shows this in the header:

# mdadm.conf written out by anaconda

So it was likely built by some choices I must've made during installation, would be my guess. I've typically run this command to generate this file by hand as root:

$ mdadm --verbose --detail --scan > /etc/mdadm.conf

Without the redirect to the /etc/mdadm.conf file this command will produce something similar to this:

$ mdadm --verbose --detail --scan 
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=48b4cedc:52404142:34d244f7:3b879f08
   devices=/dev/sda1,/dev/sdb1

I then add the following line to the end of the file if I want to be notified via email if there's any issues:

MAILADDR [email protected], [email protected]
Share:
16,100

Related videos on Youtube

Hojat Taheri
Author by

Hojat Taheri

LPIc 2 linux proffesional Security Researcher Python Programmer :)

Updated on September 18, 2022

Comments

  • Hojat Taheri
    Hojat Taheri over 1 year

    I have installed centos 6 and setup a new RAID array with two disks. every thing is ok and I have partitioned the array but I don't see any /etc/mdadm.conf or /etc/mdadm/mdadm.conf files. I have rebooted my machine too but no luck!

    Can you tell me what is my mistake? Is there a change in the location of the mdadm configuration files?

  • Hojat Taheri
    Hojat Taheri almost 11 years
    does any problem occur if this file does not exist?
  • slm
    slm almost 11 years
    The RAID should still function correctly: "When your RAID is correctly configured, the md driver is able to get everything it needs off the superblocks in the RAID components themselves. The mdadm.conf file is really just there to help guide it along when there might be some ambiguity." mdadm.conf empty... where is my config?
  • user956584
    user956584 over 9 years
    Check this one: novell.com/support/kb/doc.php?id=7001034 On bottom example with cron check