- I plug in the eSATA drive
- I wait for a long time (it’s not detected)
- I run the command to rescan the SATA port
- It works
- How would I enable auto-detection of hotplugged drives?
I’m running Fedora 32 on an HP EliteBook laptop.
00:1f.2 SATA controller [0106]: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] [8086:1e03] (rev 04) (prog-if 01 [AHCI 1.0])
Subsystem: Hewlett-Packard Company Device [103c:179b]
Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 29
I/O ports at 5048 [size=8]
I/O ports at 5054 [size=4]
I/O ports at 5040 [size=8]
I/O ports at 5050 [size=4]
I/O ports at 5000 [size=32]
Memory at d4437000 (32-bit, non-prefetchable) [size=2K]
Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
Capabilities: [70] Power Management version 3
Capabilities: [a8] SATA HBA v1.0
Capabilities: [b0] PCI Advanced Features
Kernel driver in use: ahci
[alzi@ToasterBoxeh ~]$ udevadm monitor &
[1] 5113
[alzi@ToasterBoxeh ~]$ monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
[alzi@ToasterBoxeh ~]$ echo 0 0 0 | sudo tee /sys/class/scsi_host/host4/scan
0 0 0
KERNEL[11296.362154] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0 (scsi)
KERNEL[11296.362319] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0 (scsi)
KERNEL[11296.362614] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/scsi_device/4:0:0:0 (scsi_device)
KERNEL[11296.362671] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/scsi_disk/4:0:0:0 (scsi_disk)
KERNEL[11296.363479] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/scsi_generic/sg2 (scsi_generic)
KERNEL[11296.363942] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/bsg/4:0:0:0 (bsg)
KERNEL[11296.371793] add /devices/virtual/bdi/8:16 (bdi)
[alzi@ToasterBoxeh ~]$ KERNEL[11296.469177] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb (block)
KERNEL[11296.469277] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
KERNEL[11296.469368] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb/sdb2 (block)
KERNEL[11296.469454] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb/sdb3 (block)
KERNEL[11296.469534] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb/sdb4 (block)
KERNEL[11296.469742] bind /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0 (scsi)
UDEV [11296.526387] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0 (scsi)
UDEV [11296.534929] add /devices/virtual/bdi/8:16 (bdi)
UDEV [11296.615558] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0 (scsi)
UDEV [11296.950240] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/scsi_device/4:0:0:0 (scsi_device)
UDEV [11296.960092] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/scsi_disk/4:0:0:0 (scsi_disk)
UDEV [11296.971619] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/scsi_generic/sg2 (scsi_generic)
UDEV [11296.983174] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/bsg/4:0:0:0 (bsg)
UDEV [11297.262489] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb (block)
UDEV [11297.882401] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb/sdb3 (block)
UDEV [11298.286695] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb/sdb1 (block)
UDEV [11298.337076] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb/sdb4 (block)
UDEV [11298.353224] add /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sdb/sdb2 (block)
UDEV [11298.436361] bind /devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0 (scsi)
[alzi@ToasterBoxeh ~]$