Consegui montar meu ataque no final. É assim que se faz:
mdadm --assemble --update=devicesize /dev/md2
Eu quero reduzir um mdadm RAID1 de 2 TB para 100 GB. É assim que a configuração se parece antes de encolher.
root@rescue ~ # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 4G 0 part
│ └─md0 9:0 0 4G 0 raid1
├─sda2 8:2 0 512M 0 part
│ └─md1 9:1 0 511.4M 0 raid1
├─sda3 8:3 0 2T 0 part
│ └─md2 9:2 0 2T 0 raid1
└─sda5 8:5 0 1M 0 part
sdb 8:16 0 3.7T 0 disk
├─sdb1 8:17 0 4G 0 part
│ └─md0 9:0 0 4G 0 raid1
├─sdb2 8:18 0 512M 0 part
│ └─md1 9:1 0 511.4M 0 raid1
├─sdb3 8:19 0 2T 0 part
│ └─md2 9:2 0 2T 0 raid1
└─sdb5 8:21 0 1M 0 part
loop0 7:0 0 2G 1 loop
Eu quero redimensionar / dev / md2. Aqui estão os passos que segui:
--resize filesystem / md2 raid
e2fsck -f /dev/md2
resize2fs /dev/md2 70G
e2fsck -f /dev/md2 # check
mdadm --grow /dev/md2 --size=83886080 #80GB
resize2fs /dev/md2 # expand size
e2fsck -f /dev/md2 # check
--stop md2 raid
mdadm --detail /dev/md2
mdadm --stop /dev/md2
# We checked with mdadm --examine --scan that /etc/mdadm/mdadm.conf was correct
--resize partition
parted /dev/sda
#p
#resizepart 3 100GB
#align-check optimal 3
parted /dev/sdb
#p
#resizepart 3 100GB
#align-check optimal 3
--assemble md2 raid
mdadm -A --scan
O ataque md2 não consegue montar e mostra a seguinte saída:
root@rescue ~ # mdadm -A --scan
mdadm: failed to add /dev/sdb3 to /dev/md/2: Invalid argument
mdadm: failed to add /dev/sda3 to /dev/md/2: Invalid argument
mdadm: failed to RUN_ARRAY /dev/md/2: Invalid argument
E a saída do dmesg é:
[Fri Jul 8 10:56:45 2016] md: sdb3 does not have a valid v1.2 superblock, not importing!
[Fri Jul 8 10:56:45 2016] md: md_import_device returned -22
[Fri Jul 8 10:56:45 2016] md: sda3 does not have a valid v1.2 superblock, not importing!
[Fri Jul 8 10:56:45 2016] md: md_import_device returned -22