自动挂载手动挂载的RAID阵列

自动挂载手动挂载的RAID阵列

对于我们的服务器设置,我们有一个 RAID 阵列,该阵列已设置一次,我们实际上从未重新启动过服务器。目前,该阵列运行良好,但我想将其条目添加到 fstab 中,以便自动安装它。我只是不知道该怎么做,因为我可以在 mdadm.conf 中看到该条目。RAID 阵列安装在 /dev/md1 上。

mount 命令的输出:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=4108136,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=3287872k,mode=755)
/dev/disk/by-uuid/ae73679c-c3cd-4a60-bcbb-5b6ddce867f7 on / type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=9931180k)
/dev/sdc2 on /boot type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered)
/dev/md1 on /media/attachment type ext4 (rw,relatime,user_xattr,barrier=1,stripe=256,data=ordered)

/etc/fstab 文件的内容:

proc /proc proc defaults 0 0
# /dev/sdc1 during Installation (RescueSystem)
UUID=b678077b-314c-4e2f-84ed-a3d0b3ded812 none swap sw 0 0
# /dev/sdc2 during Installation (RescueSystem)
UUID=12c0304a-21cc-4b4b-ac35-2352766620b3 /boot ext3 defaults 0 0
# /dev/sdc3 during Installation (RescueSystem)
UUID=ae73679c-c3cd-4a60-bcbb-5b6ddce867f7 / ext4 defaults 0 0

mdadm.conf 的内容:

# mdadm.conf
#
# 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

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# 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/0 metadata=1.2 UUID=067051b2:ff104bec:e0744d08:76a99a32 name=rescue:0
ARRAY /dev/md/1 metadata=1.2 UUID=b847912c:37f51b40:db18e3d7:579b580e name=rescue:1
ARRAY /dev/md/2 metadata=1.2 UUID=9a844938:07bf4ec4:73edaa03:c703df5d name=rescue:2

# This configuration was auto-generated on Mon, 25 Aug 2014 15:25:21 +0200
# by mkconf 3.2.5-5
ARRAY /dev/md/1 metadata=1.2 UUID=68e853a6:7af46176:d9c147c7:6ff87bb0 name=company:1

请告诉我该怎么做。非常感谢。:-)

答案1

我的mdraid驱动器在/etc/fstab文件中通过UUID挂载,安装时添加了一条注释:

# / was on /dev/md127 during installation
UUID=a7e381c3-8336-4768-b77b-79faf573dc20 /               ext3    errors=remount-ro 0       1

UUID 与命令给出的 UUID 匹配

blkid /dev/md127

(而不是 mdadm.conf 中的 UUID!)因此,这看起来像是可以识别安装的方式。

顺便说一句,我的系统有另一个阵列,仅通过 iSCSI 导出而不是本地安装 - 它出现在 mdadm.conf 中,但不在 /etc/fstab 中。

相关内容