Answer the question
In order to leave comments, you need to log in
What are the utilities, commands for Linux Fedora hot plugging SATA drives?
The topic was discussed on Habr until 2012:
https://habr.com/post/102387/
now it is not active for adding comments.
I created a topic on one of the forums:
and I'm trying to create and optimize a script:
for Host in $(ls -l /sys/class/scsi_host/);
do echo "- - -" >/sys/class/scsi_host$Host/scan;
done
ls -l /sys/class/scsi_host/
total 0
lrwxrwxrwx. 1 root root 0 Jan 11 16:49 host0 -> ../../devices/pci0000:00/0000:00:1f.2/ata1/host0/scsi_host/host0
lrwxrwxrwx. 1 root root 0 Jan 11 16:49 host1 -> ../../devices/pci0000:00/0000:00:1f.2/ata2/host1/scsi_host/host1
lrwxrwxrwx. 1 root root 0 Jan 11 16:49 host2 -> ../../devices/pci0000:00/0000:00:1f.2/ata3/host2/scsi_host/host2
lrwxrwxrwx. 1 root root 0 Jan 11 16:49 host3 -> ../../devices/pci0000:00/0000:00:1f.2/ata4/host3/scsi_host/host3
lrwxrwxrwx. 1 root root 0 Jan 11 16:49 host4 -> ../../devices/pci0000:00/0000:00:1f.2/ata5/host4/scsi_host/host4
lrwxrwxrwx. 1 root root 0 Jan 11 16:49 host5 -> ../../devices/pci0000:00/0000:00:1f.2/ata6/host5/scsi_host/host5
lrwxrwxrwx. 1 root root 0 Jan 11 13:50 host6 -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/ata7/host6/scsi_host/host6
lrwxrwxrwx. 1 root root 0 Jan 11 13:50 host7 -> ../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/ata8/host7/scsi_host/host7
[[email protected] Downloads]#
[[email protected] Downloads]# for Host in $(ls -l /sys/class/scsi_host/);
> do echo "- - -" >/sys/class/scsi_host$Host/scan;
> done
bash: /sys/class/scsi_hosttotal/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostlrwxrwxrwx./scan: No such file or directory
bash: /sys/class/scsi_host1/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostJan/scan: No such file or directory
bash: /sys/class/scsi_host11/scan: No such file or directory
bash: /sys/class/scsi_host16:49/scan: No such file or directory
bash: /sys/class/scsi_hosthost0/scan: No such file or directory
bash: /sys/class/scsi_host->/scan: No such file or directory
bash: /sys/class/scsi_host../../devices/pci0000:00/0000:00:1f.2/ata1/host0/scsi_host/host0/scan: No such file or directory
bash: /sys/class/scsi_hostlrwxrwxrwx./scan: No such file or directory
bash: /sys/class/scsi_host1/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostJan/scan: No such file or directory
bash: /sys/class/scsi_host11/scan: No such file or directory
bash: /sys/class/scsi_host16:49/scan: No such file or directory
bash: /sys/class/scsi_hosthost1/scan: No such file or directory
bash: /sys/class/scsi_host->/scan: No such file or directory
bash: /sys/class/scsi_host../../devices/pci0000:00/0000:00:1f.2/ata2/host1/scsi_host/host1/scan: No such file or directory
bash: /sys/class/scsi_hostlrwxrwxrwx./scan: No such file or directory
bash: /sys/class/scsi_host1/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostJan/scan: No such file or directory
bash: /sys/class/scsi_host11/scan: No such file or directory
bash: /sys/class/scsi_host16:49/scan: No such file or directory
bash: /sys/class/scsi_hosthost2/scan: No such file or directory
bash: /sys/class/scsi_host->/scan: No such file or directory
bash: /sys/class/scsi_host../../devices/pci0000:00/0000:00:1f.2/ata3/host2/scsi_host/host2/scan: No such file or directory
bash: /sys/class/scsi_hostlrwxrwxrwx./scan: No such file or directory
bash: /sys/class/scsi_host1/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostJan/scan: No such file or directory
bash: /sys/class/scsi_host11/scan: No such file or directory
bash: /sys/class/scsi_host16:49/scan: No such file or directory
bash: /sys/class/scsi_hosthost3/scan: No such file or directory
bash: /sys/class/scsi_host->/scan: No such file or directory
bash: /sys/class/scsi_host../../devices/pci0000:00/0000:00:1f.2/ata4/host3/scsi_host/host3/scan: No such file or directory
bash: /sys/class/scsi_hostlrwxrwxrwx./scan: No such file or directory
bash: /sys/class/scsi_host1/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostJan/scan: No such file or directory
bash: /sys/class/scsi_host11/scan: No such file or directory
bash: /sys/class/scsi_host16:49/scan: No such file or directory
bash: /sys/class/scsi_hosthost4/scan: No such file or directory
bash: /sys/class/scsi_host->/scan: No such file or directory
bash: /sys/class/scsi_host../../devices/pci0000:00/0000:00:1f.2/ata5/host4/scsi_host/host4/scan: No such file or directory
bash: /sys/class/scsi_hostlrwxrwxrwx./scan: No such file or directory
bash: /sys/class/scsi_host1/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostJan/scan: No such file or directory
bash: /sys/class/scsi_host11/scan: No such file or directory
bash: /sys/class/scsi_host16:49/scan: No such file or directory
bash: /sys/class/scsi_hosthost5/scan: No such file or directory
bash: /sys/class/scsi_host->/scan: No such file or directory
bash: /sys/class/scsi_host../../devices/pci0000:00/0000:00:1f.2/ata6/host5/scsi_host/host5/scan: No such file or directory
bash: /sys/class/scsi_hostlrwxrwxrwx./scan: No such file or directory
bash: /sys/class/scsi_host1/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostJan/scan: No such file or directory
bash: /sys/class/scsi_host11/scan: No such file or directory
bash: /sys/class/scsi_host13:50/scan: No such file or directory
bash: /sys/class/scsi_hosthost6/scan: No such file or directory
bash: /sys/class/scsi_host->/scan: No such file or directory
bash: /sys/class/scsi_host../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/ata7/host6/scsi_host/host6/scan: No such file or directory
bash: /sys/class/scsi_hostlrwxrwxrwx./scan: No such file or directory
bash: /sys/class/scsi_host1/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_hostroot/scan: No such file or directory
bash: /sys/class/scsi_host0/scan: No such file or directory
bash: /sys/class/scsi_hostJan/scan: No such file or directory
bash: /sys/class/scsi_host11/scan: No such file or directory
bash: /sys/class/scsi_host13:50/scan: No such file or directory
bash: /sys/class/scsi_hosthost7/scan: No such file or directory
bash: /sys/class/scsi_host->/scan: No such file or directory
bash: /sys/class/scsi_host../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0/ata8/host7/scsi_host/host7/scan: No such file or directory
[[email protected] Downloads]#
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question