Changer un disque en command line

L’interface graphique de ssa est juste insuportable. Lancée avec # ssa -local, elle peut mettre énormément de temps à s’afficher via un navigateur, et énormément de temps à afficher les informations….

TL;DR

1/ Inspecter le disque (ici le 18) avec smartctl:

$ sudo /usr/sbin/smartctl -a -d cciss,18 /dev/disk/by-id/scsi-424242abcdef0123456789ab1337

2/ Vérifier qu’il s’agit du bon disque en comparant sont SN (Serial Number) :

$ sudo ssacli ctrl slot=0 physicaldrive 1I:1:18 show detail

3/ Localiser le disque

$ sudo ssacli ctrl slot=0 physicaldrive 1I:1:18 modify led=on
$ sudo ssacli ctrl slot=0 physicaldrive 1I:1:18 modify led=off

4/ Changer manuellement le disque

5/ État du RAID et du rebuilt :

$ sudo ssacli ctrl all show config

Détecter un disque défectueux

Inspecter le disque (ici le 18) avec smartctl:

$ sudo /usr/sbin/smartctl -a -d cciss,18 /dev/disk/by-id/scsi-424242abcdef0123456789ab1337

Exemple :

[...]
Serial number: 133745XXX
[...]
SMART Health Status: OK
Current Drive Temperature: 25 C
Elements in grown defect list: 8952
Errors Corrected by Total Correction Gigabytes Total
ECC rereads/ errors algorithm processed uncorrected
read: 0 3234 0 50 0 103736.197 106
write: 0 0 0 0 0 11885.329 0
verify: 0 144 0 0 0 83.410 0
Non-medium error count: 2166
SMART Self-test log
Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
# 1 Background short Completed - 20469 - [- - -]
# 2 Background short Completed - 20445 - [- - -]
# 3 Background short Completed - 20421 - [- - -]
[...]

Le disque comporte un grand nombre d’erreurs “Elements in grown defect list: 8952“.
Sont SN est 133745XXX

Localiser le disque

Comparer les informations

Vérifier qu’il s’agit du bon disque en comparant sont SN :

# sudo ssacli ctrl slot=0 physicaldrive 1I:1:18 show detail

Exemple :

HPE Smart Array P816i-a SR Gen10 in Slot 0 (Embedded)
physicaldrive 1I:1:18
Port: 1I
Box: 1
Bay: 18
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 1.8 TB
Drive exposed to OS: False
Logical/Physical Block Size: 512/4096
Rotational Speed: 10000
Firmware Revision: HPDB
Serial Number: 133745XXX
WWID: 0123456789ABCD
Model: HPE AAAXXXBBBCCCYYYY
Current Temperature (C): 21
Maximum Temperature (C): 21
PHY Count: 2
PHY Transfer Rate: 12.0Gbps, Unknown
PHY Physical Link Rate: 12.0Gbps, Unknown
PHY Maximum Link Rate: 12.0Gbps, 12.0Gbps
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
Sanitize Erase Supported: True
Sanitize Estimated Max Erase Time: 2 hour(s), 45 minute(s)
Unrestricted Sanitize Supported: True
Shingled Magnetic Recording Support: None
Drive Unique ID: 9876543210FEDCBA
Multi-Actuator Drive: False
Write Cache Status: Disabled

Localiser le disque

Pour allumer/éteindre le disque :

$ sudo ssacli ctrl slot=0 physicaldrive 1I:1:18 modify led=on
$ sudo ssacli ctrl slot=0 physicaldrive 1I:1:18 modify led=off

Changer le disque

Changer manuellement le disque

Surveiller le rebuilt

État du RAID et du rebuilt :

$ sudo ssacli ctrl all show config

Exemple :

Array A (SAS, Unused Space: 0  MB)

logicaldrive 1 (279.37 GB, RAID 1, OK)

physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS HDD, 300 GB, OK)
physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS HDD, 300 GB, OK)


Array B (SAS, Unused Space: 0 MB)

logicaldrive 2 (34.39 TB, RAID 6, Recovering, 86.15% complete)

physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:5 (port 1I:box 1:bay 5, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:6 (port 1I:box 1:bay 6, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:7 (port 1I:box 1:bay 7, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:8 (port 1I:box 1:bay 8, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:9 (port 1I:box 1:bay 9, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:10 (port 1I:box 1:bay 10, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:11 (port 1I:box 1:bay 11, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:12 (port 1I:box 1:bay 12, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:13 (port 1I:box 1:bay 13, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:14 (port 1I:box 1:bay 14, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:15 (port 1I:box 1:bay 15, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:16 (port 1I:box 1:bay 16, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:17 (port 1I:box 1:bay 17, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:19 (port 1I:box 1:bay 19, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:20 (port 1I:box 1:bay 20, SAS HDD, 1.8 TB, Rebuilding)
physicaldrive 1I:1:21 (port 1I:box 1:bay 21, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:22 (port 1I:box 1:bay 22, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:23 (port 1I:box 1:bay 23, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:24 (port 1I:box 1:bay 24, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:25 (port 1I:box 1:bay 25, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:27 (port 1I:box 1:bay 27, SAS HDD, 1.8 TB, OK)
physicaldrive 1I:1:18 (port 1I:box 1:bay 18, SAS HDD, 1.8 TB, OK, auto replace spare)

Documentation

Doc ssa

🡅 Partager