Reset bus pci et sata » Historique » Version 2
Laurent GUERBY, 21/07/2021 22:15
1 | 1 | Aymeric APLU | h1. Reset bus pci et sata |
---|---|---|---|
2 | 1 | Aymeric APLU | |
3 | 1 | Aymeric APLU | h2. retirer un disque à chaud |
4 | 1 | Aymeric APLU | |
5 | 1 | Aymeric APLU | il est possible de retirer un disque (encore présent) à chaud en utilisant |
6 | 1 | Aymeric APLU | |
7 | 1 | Aymeric APLU | <pre> |
8 | 1 | Aymeric APLU | echo 1 > /sys/block/sdX/device/delete |
9 | 1 | Aymeric APLU | </pre> |
10 | 1 | Aymeric APLU | |
11 | 1 | Aymeric APLU | h2. faire un scan bus |
12 | 1 | Aymeric APLU | |
13 | 1 | Aymeric APLU | Si lors du hotplug le disque n'est pas reconnu on peut forcer un scan du bus avec |
14 | 1 | Aymeric APLU | |
15 | 1 | Aymeric APLU | <pre> |
16 | 1 | Aymeric APLU | echo "- - -" > /sys/class/scsi_host/host1/scan |
17 | 1 | Aymeric APLU | </pre> |
18 | 1 | Aymeric APLU | |
19 | 1 | Aymeric APLU | On identifie host1 avec |
20 | 1 | Aymeric APLU | |
21 | 1 | Aymeric APLU | <pre> |
22 | 1 | Aymeric APLU | root@g21:~# lspci | grep -E SATA\|SCSI |
23 | 1 | Aymeric APLU | 2b:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51) |
24 | 1 | Aymeric APLU | 2c:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51) |
25 | 1 | Aymeric APLU | 2e:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03) |
26 | 1 | Aymeric APLU | root@g21:~# ls /sys/class/scsi_host -lh |grep 2e |
27 | 1 | Aymeric APLU | lrwxrwxrwx 1 root root 0 Jun 1 22:15 host3 -> ../../devices/pci0000:00/0000:00:03.2/0000:2e:00.0/host3/scsi_host/host3 |
28 | 1 | Aymeric APLU | </pre> |
29 | 1 | Aymeric APLU | |
30 | 2 | Laurent GUERBY | Ce n’est pas gênant de faire un scan même si il n’y a rien de nouveau. |
31 | 1 | Aymeric APLU | |
32 | 2 | Laurent GUERBY | h2. reset de device pci |
33 | 1 | Aymeric APLU | |
34 | 1 | Aymeric APLU | Attention ! S'il y'a d'autres disques de branché sur la carte cela reset tous les disques ! |
35 | 1 | Aymeric APLU | |
36 | 1 | Aymeric APLU | Comme précédemment on identifie le port PCI de la carte avec lspci. |
37 | 1 | Aymeric APLU | |
38 | 1 | Aymeric APLU | Puis faire |
39 | 1 | Aymeric APLU | |
40 | 1 | Aymeric APLU | <pre> |
41 | 1 | Aymeric APLU | echo 1 > /sys/bus/pci/devices/0000\:2e\:00.0/reset |
42 | 1 | Aymeric APLU | </pre> |
43 | 1 | Aymeric APLU | |
44 | 1 | Aymeric APLU | On peut confirmer le reset en regardant dmesg. |
45 | 1 | Aymeric APLU | |
46 | 1 | Aymeric APLU | h1. sources |
47 | 1 | Aymeric APLU | |
48 | 1 | Aymeric APLU | * https://unix.stackexchange.com/questions/29775/reset-a-pci-device-in-linux |
49 | 1 | Aymeric APLU | * https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci |
50 | 1 | Aymeric APLU | * https://www.linux-geex.com/linux-reset-sata-bus/ |