====== Opérations SCSI volumes SAN ====== ===== Ajout d’un nouveau disque à chaud ===== Lorsqu’on ajoute un disque à un système et qu’on ne veut pas redémarrer, on peut le faire avec la commande suivante qui rescan le bus SCSI. echo - - - > /sys/class/scsi_host/host$NUMERHOST/scan S'aider de la commande ''lsscsi'' pour obtenir des informations. ==== How to scan the SCSI bus with a 2.6 kernel ==== Documentation volontairement recopié pour ne pas perdre l'information. Elle se trouve à cet endroit : http://misterd77.blogspot.com/2007/12/how-to-scan-scsi-bus-with-26-kernel.html If you are playing with SCSI devices (like Fibre Channel, SAS, ..) you sometimes need to rescan the SCSI bus to add devices or to tell the kernel a device is gone. Well, this is the way to do it in CentOS with versions that have a 2.6 kernel. This means CentOS 5 and CentOS 4 (starting from update 3). - Find what's the host number for the HBA ls /sys/class/fc_host/ (You'll have something like host1 or host2, I'll refer to them as host$NUMBER from now on). - Ask the HBA to issue a LIP signal to rescan the FC bus echo 1 >/sys/class/fc_host/host$NUMBER/issue_lip - Wait around 15 seconds for the LIP command to have effect. - Ask Linux to rescan the SCSI devices on that HBA echo - - - >/sys/class/scsi_host/host$NUMBER/scan The wildcards "- - -" mean to look at every channel, every target, every lun. That's it. You can look for log messages at "dmesg" to see if it's working, and you can look at ''/proc/scsi/scsi'' to see if the devices are there. In CentOS 5 there is also the "lsscsi" command that will show you the know devices plus the device entries that point to those devices (very usefull). For more information about how this works see the the upstream release notes for 4.3 : http://www.centos.org/docs/4/html/release-notes/as-x86/RELEASE-NOTES-U3-en.html#id3641770 ===== Prise en compte d’une modification de taille ===== Lorsqu’on a un volume monté en utilisation, qu’on augmente la taille de la LUN sur le SAN et qu’on veut voir la nouvelle taille sans redémarrer le système. echo 1 > /sys/class/scsi_disk/0\:0\:1\:0/device/rescan 0\:0\:1\:0 le dernier 0 est l’ID SCSI de la LUN du SAN. S'aider de la commande lsscsi pour obtenir des informations. ===== Mêmes opérations avec les outils constructeurs ===== ==== Red Hat ==== Disponible avec le paquet sg3-utils on dispose ensuite de la commande suivante qui est un script positionné sur le système. rescan-scsi-bus.sh ==== HP ==== /opt/hp/hp_fibreutils/hp_rescan -a ==== IBM mppUtil ==== mppBusRescan -s #scan de nouveaux disques mppBusRescan -u #mise à jour des mappings de disques existants