Я попытался настроить RAID1 с mdadm на Raspberrypi 4. Я не уверен, правильно ли настроен raid.
Вот что показывает lsblk перед установкой:
pi@e11:/dev $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
sdb 8:16 0 931.5G 0 disk
mmcblk0 179:0 0 59.5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 59.2G 0 part /
Вот что я сделал:
pi@e11:/dev $ sudo parted /dev/sda "mklabel gpt"
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
Information: You may need to update /etc/fstab.
pi@e11:/dev $ sudo parted /dev/sdb "mklabel gpt"
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
Information: You may need to update /etc/fstab.
pi@e11:/dev $ sudo parted /dev/sda "mkpart primary ext4 1M -1"
Information: You may need to update /etc/fstab.
pi@e11:/dev $ sudo parted /dev/sdb "mkpart primary ext4 1M -1"
Information: You may need to update /etc/fstab.
pi@e11:/dev $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part
mmcblk0 179:0 0 59.5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 59.2G 0 part /
pi@e11:/dev $ sudo parted /dev/sda "set 1 raid on"
Information: You may need to update /etc/fstab.
pi@e11:/dev $ sudo parted /dev/sdb "set 1 raid on"
Information: You may need to update /etc/fstab.
pi@e11:/dev $ sudo parted -s /dev/sda print
Model: TOSHIBA External USB 3.0 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 1000GB 1000GB primary raid
pi@e11:/dev $ sudo parted -s /dev/sdb print
Model: TOSHIBA External USB 3.0 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 1000GB 1000GB primary raid
pi@e11:/dev $ sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
Lsblk после:
pi@e11:/dev $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part
└─md0 9:0 0 931.4G 0 raid1
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part
mmcblk0 179:0 0 59.5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 59.2G 0 part /
Я бы ожидал, что sdb1 также должен выглядеть как sda1, не так ли?
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part
└─md0 9:0 0 931.4G 0 raid1
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part
└─md0 9:0 0 931.4G 0 raid1
Если я прав. Что еще можно добавить sdb1 в массив raid?
Заранее спасибо. Christoph