Може да видим състоянието на софтуерният райд масив в FreeBSD чрез gmirror инструмента:
Edit /etc/motd to change this login announcement.
root@rio:~ # gmirror status
Name Status Components
mirror/gm0 DEGRADED ada0 (ACTIVE)
Както виждаме, райд масива е в статус „DEGRADED“, и ние трябва да подменим изключеният от масива диск .
Нека видим съобщенията от FreeBSD кернела:
ada0 at ata2 bus 0 scbus1 target 0 lun 0
ada0: ATA8-ACS SATA 3.x device
ada0: Serial Number Z3TVQPZE
ada0: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada0: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada0: quirks=0x1<4K>
ada0: Previously was known as ad4
ada1 at ata3 bus 0 scbus2 target 0 lun 0
ada1: ATA8-ACS SATA 3.x device
ada1: Serial Number Z3TVTVZ5
ada1: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada1: quirks=0x1<4K>
ada1: Previously was known as ad6
GEOM_MIRROR: Component ada1 (device gm0) broken, skipping.
GEOM_MIRROR: Cancelling unmapped because of ada0.
GEOM_MIRROR: Device mirror/gm0 launched (1/2).
GEOM_MIRROR: Component diskid/DISK-Z3TVTVZ5 (device gm0) broken, skipping.
GEOM_MIRROR: Cannot add disk diskid/DISK-Z3TVTVZ5 to gm0 (error=22).
ada0 at ata2 bus 0 scbus1 target 0 lun 0
ada0: ATA8-ACS SATA 3.x device
ada0: Serial Number Z3TVQPZE
ada0: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada0: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada0: quirks=0x1<4K>
ada0: Previously was known as ad4
ada1 at ata3 bus 0 scbus2 target 0 lun 0
ada1: ATA8-ACS SATA 3.x device
ada1: Serial Number Z3TVTVZ5
ada1: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada1: quirks=0x1<4K>
ada1: Previously was known as ad6
GEOM_MIRROR: Component ada1 (device gm0) broken, skipping.
GEOM_MIRROR: Cancelling unmapped because of ada0.
GEOM_MIRROR: Device mirror/gm0 launched (1/2).
GEOM_MIRROR: Component diskid/DISK-Z3TVTVZ5 (device gm0) broken, skipping.
GEOM_MIRROR: Cannot add disk diskid/DISK-Z3TVTVZ5 to gm0 (error=22).
Чрез gmirror forget , указваме на райд масива да „забрави“ дисковете които не са свързани в масива.
root@rio:~ # gmirror status
Name Status Components
mirror/gm0 DEGRADED ada0 (ACTIVE)
root@rio:~ # gmirror forget gm0
root@rio:~ # gmirror status
Name Status Components
mirror/gm0 COMPLETE ada0 (ACTIVE)
След това, изваждаме проблемният диск и добавяме новият.
root@rio:~ # dmesg | grep ada
ada0 at ata2 bus 0 scbus1 target 0 lun 0
ada0: ATA8-ACS SATA 3.x device
ada0: Serial Number Z3TVQPZE
ada0: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada0: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada0: quirks=0x1<4K>
ada0: Previously was known as ad4
ada1 at ata3 bus 0 scbus2 target 0 lun 0
ada1: ATA8-ACS SATA 3.x device
ada1: Serial Number Z3TVTVZ5
ada1: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada1: quirks=0x1<4K>
ada1: Previously was known as ad6
GEOM_MIRROR: Component ada1 (device gm0) broken, skipping.
GEOM_MIRROR: Cancelling unmapped because of ada0.
FreeBSD системата, за да идентифицира новият хард диск, трябва да „ресканираме“ контролера чрез инструмента camcontrol.
root@rio:~ # camcontrol rescan all
Re-scan of bus 0 was successful
Re-scan of bus 1 was successful
Re-scan of bus 2 was successful
Проверяваме дали виждаме новият диск:
root@rio:~ # dmesg | grep ada
ada0 at ata2 bus 0 scbus1 target 0 lun 0
ada0: ATA8-ACS SATA 3.x device
ada0: Serial Number Z3TVQPZE
ada0: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada0: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada0: quirks=0x1<4K>
ada0: Previously was known as ad4
ada1 at ata3 bus 0 scbus2 target 0 lun 0
ada1: ATA8-ACS SATA 3.x device
ada1: Serial Number Z3TVTVZ5
ada1: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada1: quirks=0x1<4K>
ada1: Previously was known as ad6
GEOM_MIRROR: Component ada1 (device gm0) broken, skipping.
GEOM_MIRROR: Cancelling unmapped because of ada0.
ada1 at ata3 bus 0 scbus2 target 0 lun 0
ada1: s/n WD-WCASY7850929 detached
(ada1:ata3:0:0:0): Periph destroyed
ada1 at ata3 bus 0 scbus2 target 0 lun 0
ada1: ATA8-ACS SATA 2.x device
ada1: Serial Number WD-WCASY7850929
ada1: 150.000MB/s transfers (SATA, UDMA5, PIO 8192bytes)
ada1: 610480MB (1250263728 512 byte sectors: 16H 63S/T 16383C)
ada1: Previously was known as ad6
Виждаме статуса на райд масива, след което добавяме новият диск.
Препоръчително е преди да добавим диска в масива, да изчистим неговата метадата в случай че е участвал в друг райд масив.
root@rio:~ # gmirror status
Name Status Components
mirror/gm0 COMPLETE ada0 (ACTIVE)
root@rio:~ # gmirror insert gm0 ada1
root@rio:~ # gmirror status
Name Status Components
mirror/gm0 DEGRADED ada0 (ACTIVE)
ada1 (SYNCHRONIZING, 0%)
Проверяваме статуса на ребилдване:
root@rio:~ # gmirror status
Name Status Components
mirror/gm0 DEGRADED ada0 (ACTIVE)
ada1 (SYNCHRONIZING, 14%)
В случай че имате нужда от помощ при поддръжка на вашите FreeBSD сървъри, може да се обърнете към нас за безплатна ИТ консултация.
Още от нашия блог
Всички постовеRecent Posts
- Деинсталация на Java в Mac OS X 10.14.6 февруари 23, 2021
- Cisco SPA504G Firmware Upgrade декември 1, 2020
- За какво използваме лоуд балансери ? октомври 12, 2020