Some commands:
MegaCli -AdpAllinfo -aALL
MegaCli -AdpEventLog -GetEvents -f eventlog.txt -aAll
How do I replace a failed drive:
# Show Drive Information
./storcli /c0/eall/sall show
# Set the failed drive
./storcli /c0/e245/s4 set offline
# Set the failed drive as missing
./storcli /c0/e245/s4 set missing
# Spindown the failed drive
./storcli /c0/eall/s4 spindown
# Locale drive
./storcli /cx[/ex]/sx start locate
./storcli /cx[/ex]/sx stop locate
# Show rebuild
./storcli /c0/eall/sall show rebuild
spare drive
# Add drive hotsparedrive global
./storcli /cx[/ex]/sx add hotsparedrive
# sample
./storcli /c0/e32/s8 set good force
./storcli /c0/e32/s8 add hotsparedrive
alarm control
# MegaCli64 -AdpSetProp <AlarmEnbl | AlarmDsbl | AlarmSilence> -aN
# storcli /cx set alarm=<on | off | silence>
buscar serial number
# ./storcli /c0/eall/sall show all | egrep 'Device attributes|SN = '
converter VD de RAID0 para RAID1
# ./megacli -ldrecon -start -r1 -add -physdrv[Enc:Slot] -l???VD??? -aAdaptadorID
# ./megacli -ldrecon -start -r1 -add -physdrv[252:1] -l0 -a0
Como remover um disco de um pool e colocar para ser RAID1 de um RAID0
# ./megaclisas-status
# ./storcli /c0/eall/sall show
# ./storcli /c0/e252/s1 set offline
# ./storcli /c0/e252/s1 set missing
# ./storcli /c0/eall/sall show
# ./megacli -ldrecon -start -r1 -add -physdrv[252:1] -l0 -a0
# ./megaclisas-status
Cópia da tabela de partição
sfdisk -d /dev/sdc | sfdisk /dev/sdb
mdadm (raid via software)
# mdadm --detail /dev/md127
# mdadm --stop --scan
# mdadm --assemble --scan
# opção com force:
mdadm --stop /dev/md1
mdadm --assemble --scan --force
mdadm (raid via software) - replace
# mdadm --query --detail /dev/md2
# cat /proc/mdstat
## Remove the failing disk from the RAID array
# mdadm --manage /dev/md2 --remove /dev/sdb4
## para ver o serial do disco: lsblk -o NAME,SERIAL,SIZE
# cat /proc/mdstat
## Shut down the machine and replace the disk
## Create partition raid ;)
## para copiar a estrutura de tabela de partição: sudo sfdisk -d /dev/sda | sudo sfdisk /dev/sdb
## Add the new disk to the RAID array
# mdadm --manage /dev/md2 --add /dev/sdb4
# cat /proc/mdstat
# mdadm --query --detail /dev/md2
## caso o disco seja do sistema, cuidado com o grub, pois pode ser que estaja com o grub em apenas em um dos discos para reinstalar basta rodar o grub2-install em ambos os discos : grub2-install /dev/sda ; grub2-install /dev/sdb
para controladora HP:
- [https://gist.github.com/mrpeardotnet/a9ce41da99936c0175600f484fa20d03]
Links interessantes
- Pacotes para HP hpacucli | storcli ...: https://downloads.linux.hpe.com/SDR/repo/mcp/pool/non-free/
https://hwraid.le-vert.net/wiki/SmartArray
ssacli : https://gist.github.com/mrpeardotnet/a9ce41da99936c0175600f484fa20d03
- [[https://phoenixnap.com/kb/how-to-set-up-hardware-raid-megacli|https://phoenixnap.com/kb/how-to-set-up-hardware-raid-megacli]]
- [[https://sobrelinux.info/questions/683537/convert-single-disk-raid0-to-raid1-on-an-lsi-megaraid-controller|https://sobrelinux.info/questions/683537/convert-single-disk-raid0-to-raid1-on-an-lsi-megaraid-controller]]
- RAID0 to RAID1 : [[https://support.huawei.com/enterprise/en/doc/EDOC1000004186/472fd163/common-storcli-commands|https://support.huawei.com/enterprise/en/doc/EDOC1000004186/472fd163/common-storcli-commands]]
- [[http://fibrevillage.com/storage/709-storcli-drive-command-examples|http://fibrevillage.com/storage/709-storcli-drive-command-examples]]
- [[https://serverfault.com/questions/877314/how-to-add-a-hotspare-with-storcli-to-a-lsi-megaraid-controller|https://serverfault.com/questions/877314/how-to-add-a-hotspare-with-storcli-to-a-lsi-megaraid-controller]]
- [[https://www.thomas-krenn.com/en/wiki/StorCLI_commands|https://www.thomas-krenn.com/en/wiki/StorCLI_commands]]
- [[https://serverfault.com/questions/877314/how-to-add-a-hotspare-with-storcli-to-a-lsi-megaraid-controller#|https://serverfault.com/questions/877314/how-to-add-a-hotspare-with-storcli-to-a-lsi-megaraid-controller#]]
- [[https://www.45drives.com/wiki/index.php?title=How_do_I_replace_a_failed_drive_with_LSI_9280_cards%3F|https://www.45drives.com/wiki/index.php?title=How_do_I_replace_a_failed_drive_with_LSI_9280_cards%3F]]
- [[https://support.siliconmechanics.com/portal/en/kb/articles/silencing-raid-controller-alarms|https://support.siliconmechanics.com/portal/en/kb/articles/silencing-raid-controller-alarms]]
-
If auto rebuild isn./storcli64 /cx/ey/sz insert dg=0 array=0 row=0 (dg, array, row correspond to the Topology table from ) Then start the rebuild manually
Download
- megacli / storcli / megaclisas-status: [[https://www.ic.unicamp.br/~william/howto/megacli-storcli.html|https://www.ic.unicamp.br/~william/howto/megacli-storcli.html]]