- Исходные данные
~# cat /etc/os-release ... Ubuntu 16.04.3 LTS ...
- Удаляем диск из массивов.
Итак, в силу определенных причин у нас есть три диска /dev/sda /dev/sdb /dev/sdc, которые входят в состав трех raid-1 /dev/md0 /dev/md1 /dev/md2:# fdisk -l Disk /dev/sda: 477 GiB, 512110190592 bytes, 1000215216 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x52cdd752 Device Boot Start End Sectors Size Id Type /dev/sda1 2048 33556479 33554432 16G fd Linux raid autodetect /dev/sda2 33556480 34605055 1048576 512M fd Linux raid autodetect /dev/sda3 34605056 1000213167 965608112 460.4G fd Linux raid autodetect Disk /dev/sdb: 477 GiB, 512110190592 bytes, 1000215216 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xd93ff5b4 Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 33556479 33554432 16G fd Linux raid autodetect /dev/sdb2 33556480 34605055 1048576 512M fd Linux raid autodetect /dev/sdb3 34605056 1000213167 965608112 460.4G fd Linux raid autodetect Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0x2b083ee4 Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 33556479 33554432 16G fd Linux raid autodetect /dev/sdc2 33556480 34605055 1048576 512M fd Linux raid autodetect /dev/sdc3 34605056 1000213167 965608112 460.4G fd Linux raid autodetect Disk /dev/md1: 511.4 MiB, 536281088 bytes, 1047424 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/md0: 16 GiB, 17163091968 bytes, 33521664 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/md2: 460.3 GiB, 494257111040 bytes, 965345920 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
и нам хочется удалить из всех raid диск /dev/sdc сохранив при этом существующие данные.
Приступаем:# mdadm --manage /dev/md0 --fail /dev/sdc1 mdadm: set /dev/sdc1 faulty in /dev/md0 # mdadm --manage /dev/md0 -r /dev/sdc1 mdadm: hot removed /dev/sdc1 from /dev/md0 # mdadm --manage /dev/md1 --fail /dev/sdc2 mdadm: set /dev/sdc2 faulty in /dev/md1 # mdadm --manage /dev/md1 -r /dev/sdc2 mdadm: hot removed /dev/sdc2 from /dev/md1 # mdadm --manage /dev/md2 --fail /dev/sdc3 mdadm: set /dev/sdc3 faulty in /dev/md2 # mdadm --manage /dev/md2 -r /dev/sdc3 mdadm: hot removed /dev/sdc3 from /dev/md2
Перезагружаем:# reboot
Проверяем:# cat /proc/mdstat Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] md2 : active raid1 sdb3[1] sda3[0] 482672960 blocks super 1.2 [3/2] [UU_] bitmap: 4/4 pages [16KB], 65536KB chunk md0 : active raid1 sdb1[1] sda1[0] 16760832 blocks super 1.2 [3/2] [UU_] md1 : active raid1 sdb2[1] sda2[0] 523712 blocks super 1.2 [3/2] [UU_]
Статья опубликована: 2018-02-05 18:55:47
Последние правки: 2019-10-16 00:01:18
Инструкция как удалить диск из массивов в Ubuntu.