使用 mdadm 在新的 Kubuntu 安装上组装 Raid 阵列

使用 mdadm 在新的 Kubuntu 安装上组装 Raid 阵列

我最近刚刚在我的计算机上重新安装了 Kubuntu,还安装了 mdadm 来重新组装我之前的三个 raid 阵列。我没有为这些阵列保留任何配置文件,但安装 mdadm 会自动生成一个 conf 文件,其中包含似乎是阵列的正确信息。

我是否只需要mdadm --assemble --scan以 root 身份运行即可重新组装阵列?这似乎是建议的,但我不确定是否需要在阵列中包含一些预定义的信息,或者是否有多个不同的 raid 阵列会使过程复杂化。

自动生成的 conf 文件中包含的内容如下:

# mdadm.conf
#
# !NB! Run update-initramfs -u after updating this file.
# !NB! This will ensure that initramfs has an uptodate copy.
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays
ARRAY /dev/md/4  metadata=1.2 UUID=9ff1aadf:fa7b7505:c8f39299:6647dfa1 name=Alice:4
ARRAY /dev/md/2  metadata=1.2 UUID=4b6b4aaf:eb9b31f3:d93da362:8e12e52c name=Alice:2
ARRAY /dev/md/3  metadata=1.2 UUID=0647af50:798149a3:4bcfe806:585ab84c name=Alice:3

# This configuration was auto-generated on Tue, 31 Aug 2021 02:48:58 -0400 by mkconf

答案1

看来我有点偏执和愚蠢。重新启动时,RAID 卷会按预期自动检测,无需干预。因此,为了回答我的问题,自动生成的配置文件可能包含有关 RAID 阵列的所有正确信息,并且mdadm --assemble --scan可能是无需重新启动即可重新组装阵列的正确命令。

相关内容