Il post descrive la procedura per rimuovere il mirror con mdadm. L'esempio qui utilizzato ha RAID1 creato con i dispositivi /dev/sdb e /dev/sdc. Rimuoveremo il dispositivo /dev/sdb . Per cominciare, non creare prima il mirror RAID1.
Passaggi
1. Crea un dispositivo raid1 con i dischi /dev/sdb e /dv/sdc :
# mdadm -Cv /dev/md0 -l1 -n2 /dev/sdb /dev/sdc mdadm: /dev/sdb appears to contain an ext2fs file system size=2097152K mtime=Wed May 8 12:39:49 2013 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 mdadm: /dev/sdc appears to contain an ext2fs file system size=2097152K mtime=Wed May 8 12:39:53 2013 mdadm: size set to 2096116K Continue creating array? y mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started.
2. Controlla lo stato del dispositivo md :
# cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdc[1] sdb[0] 2096116 blocks super 1.2 [2/2] [UU] unused devices: <none>
3. Contrassegna il disco /dev/sdb come guasto nel mirror:
# mdadm /dev/md0 --fail /dev/sdb mdadm: set /dev/sdb faulty in /dev/md0
4. Rimuovere il disco /dev/sdb dal mirror:
# mdadm /dev/md0 --remove /dev/sdb mdadm: hot removed /dev/sdb from /dev/md0
5. Ricontrolla lo stato del dispositivo md :
# cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdc[1] 2096116 blocks super 1.2 [2/1] [_U] unused devices: <none>