Welcome to the Linux Foundation Forum!

RAID Solution 24.1, question about mdadm --detail



I have two questions:

First: In the course and in the training the method to put the ARRAY into mdadm.conf file is
sudo bash -c "mdadm --detail --scan >> /etc/mdadm.conf". Why calling bash with sudo here? Why not calling mdadm with sudo direct like:
sudo mdadm --detail --scan >>/etc/mdadm.conf

Can anyone tell?

Second: You place the conf file in /etc (/etc/mdadm.conf) but on my ubuntu system "man mdadm" tells in the section about the --config switch, that the default is to use /etc/mdadm/mdadm.conf and if this is not present, to use /etc/mdadm.conf.

So on my system the /etc/mdadm/mdadm.conf file is present. Do I not have to put the ARRAY section in here rather than creating a new file /dev/mdadm.conf ?




  • coop
    coop Posts: 915

    you can never do things like sudo echo hello > /hello, as sudo doesn't work with redirection; that is a separate process from the echo and is not givcen rights; try it, so you must become root or do the sudo bash -c trick

    for your second question, distros differ exactly where they put files so follow the setup on your system, that should work.


Upcoming Training