16.7. Creating a software RAID on an installed system


You can create a software Redundant Array of Independent Disks (RAID) on an existing system by using the mdadm utility.

Prerequisites

Procedure

  1. Create a RAID of two block devices, for example /dev/sda1 and /dev/sdc1:

    # mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sda1 /dev/sdc1
    mdadm: Defaulting to version 1.2 metadata
    mdadm: array /dev/md0 started.

    The level_value option defines the RAID level.

  2. Optional: Check the status of the RAID:

    # mdadm --detail /dev/md0
    /dev/md0:
               Version : 1.2
         Creation Time : Thu Oct 13 15:17:39 2022
            Raid Level : raid0
            Array Size : 18649600 (17.79 GiB 19.10 GB)
          Raid Devices : 2
         Total Devices : 2
           Persistence : Superblock is persistent
    
           Update Time : Thu Oct 13 15:17:39 2022
                 State : clean
        Active Devices : 2
       Working Devices : 2
        Failed Devices : 0
         Spare Devices : 0
    [...]
  3. Optional: Observe the detailed information about each device in the RAID:

    # mdadm --examine /dev/sda1 /dev/sdc1
    /dev/sda1:
              Magic : a92b4efc
            Version : 1.2
        Feature Map : 0x1000
         Array UUID : 77ddfb0a:41529b0e:f2c5cde1:1d72ce2c
               Name : 0
      Creation Time : Thu Oct 13 15:17:39 2022
         Raid Level : raid0
       Raid Devices : 2
    [...]
  4. Create a file system on the RAID drive:

    # mkfs -t xfs /dev/md0

    Replace xfs with the file system that you chose to format the drive with.

  5. Create a mount point for RAID drive and mount it:

    # mkdir /mnt/raid1
    # mount /dev/md0 /mnt/raid1

    Replace /mnt/raid1 with the mount point.

    If you want that RHEL mounts the md0 RAID device automatically when the system boots, add an entry for your device to the /etc/fstab file:

    /dev/md0   /mnt/raid1 xfs  defaults   0 0
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部