遇到同样的问题后,这个食谱对我有用。环顾四周,试图找到答案,最后遇到了这个问题,仍然没有帮助。
我认为这个问题是多重的。
mdadm reassigns the device files from /dev/md0 to something like /dev/md127 on the next reboot. So you cannot just use the device file in the fstab. I ended up using the UUID, from the created filesystem.
Almost all the RAID drive setup tutorials on the web are showing the creation of the RAID device using the driver device files like this:
mdadm --create --verbose /dev/md0 --level=0 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd
Instead I used the partition device files, like this:
mdadm --create --verbose /dev/md0 --level=0 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
The second form requires proper creation of partitions on each disk using gdisk or fdisk. I used gdisk and assigned it as type fd00, which is a raid partition.
There's lots of talk about needing to update /etc/mdadm/mdadm.conf. This is wrong. I purposefully, deleted that file. It's not needed. (See below)
真的就是全部。完整食谱如下...
Partition each drive with one partition of type fd00, Linux RAID:
root@teamelchan:~# gdisk /dev/sda
Command (? for help): n
Partition number (1-128, default 1):
First sector (2048-3907029134, default = 2048) or {+-}size