Help Center/ Elastic Volume Service/ Best Practices/ RAID Array Creation with EVS Disks/ Implementation Procedure/ Configuring Automatic Start of the RAID Array at Server Startup
Updated on 2023-06-21 GMT+08:00

Configuring Automatic Start of the RAID Array at Server Startup

Scenarios

This section shows how to add RAID array information, such as the device name and UUID to the mdadm configuration file. In this case, the RAID array can be started by querying information in the configuration file when the system starts.

In this example, the ECS runs CentOS 7.4 64bit. Configurations vary depending on the OS running on the ECS. This section is used for reference only. For the detailed operations and differences, see the corresponding OS documents.

Procedure

  1. Log in to the ECS as user root.
  2. Run the following command to view the RAID array information:

    mdadm --detail --scan

    Information similar to the following is displayed:
    [root@ecs-raid10 ~]# mdadm --detail --scan
    ARRAY /dev/md0 metadata=1.2 name=ecs-raid10.novalocal:0 UUID=f400dbf9:60d211d9:e006e07b:98f8758c

  3. Perform the following operations to add information of the new RAID array to the mdadm file:

    1. Run the following command to open the mdadm.conf file:

      vi /etc/mdadm.conf

    2. Press i to enter editing mode.
    3. Add the following information to the end of the file:
      DEVICE /dev/vdb /dev/vdc /dev/vdd /dev/vde
      ARRAY /dev/md0 metadata=1.2 name=ecs-raid10.novalocal:0 UUID=f400dbf9:60d211d9:e006e07b:98f8758c

      Description:

      • DEVICE line: Indicates the device names of the disks that set up the RAID array. Multiple device names are separated with spaces.
      • ARRAY line: Indicates RAID array information. Input the RAID array information obtained in 2.

      The preceding information is used for reference only. Add RAID array information based on the site information.

    4. Press Esc, enter :wq!, and press Enter.

      The system saves the modifications and exits the vi editor.

  4. Run the following command to check whether the mdadm.conf file is modified:

    more /etc/mdadm.conf

    Information similar to the following is displayed:
    [root@ecs-raid10 ~]# more /etc/mdadm.conf
    DEVICE /dev/vdb /dev/vdc /dev/vdd /dev/vde
    ARRAY /dev/md0 metadata=1.2 name=ecs-raid10.novalocal:0 UUID=f400dbf9:60d211d9:e006e07b:98f8758c

    If the information added in 3 is displayed, the file is successfully modified.