I have a problem with an external (which is actually internal) hard drive connected to laptop through eSATA port. Fedora didn’t identify it when I turned its power block on, so I searched for a way to make Fedora find the disk and found the command:
echo “- - -” > /sys/class/scsi_host/$HOST/scan
But even with sudo crappy bash refused to execute (WTF?). So I had to relogin as root (which I wisely left enabled during installation), executed it for each of the 6 hosts and on the last one the disk was found. Then i found out that there is a Red Hat sg3_utils with a script for SCSI bus rescanning. So I created this and put it on the desktop:
#!/bin/bash #Rescan host5 of SCSI bus to discover external hard drive sudo rescan-scsi-bus.sh --hosts=host5
I wanted to call this script every time I turn on the hard drive. But next time I did it nothing happened. I tried running it manually for every one of the six hosts - nothing (0 devices found). What the shit is going on? I won’t login as root every time to fetch the disk.
This is a bit confusing!
Booting a fedora install has nothing to do with other hosts, unless the drive is externally mounted with nfs or smb or similar.
You say this drive is eSATA and internal on a laptop, which is also confusing.
Scanning a scsi bus is only pertinent on the current host.
Thus when you say you scanned the bus for 6 different hosts it seems unusual at best.
Please provide the output of lspci, lsusb, lsblk, and sudo fdisk -l so we can see what hardware the system sees and configures at boot time. Use the </> Preformatted text tags with those outputs so we can see the results the same as you do on screen.
What is confusing is your answer actually.
“Booting a fedora install” - what does it mean? I didn’t manage to decrypt.
This drive I’m talking about is connected to eSATA, but it is not an external drive by design, it’s a usual SATA drive for the desktop which I turned into external by putting it on the table and connecting to a laptop with SATA-eSATA cable (and to an old desktop power block).
I don’t know what “current host” means. In the aforementioned folder I see several hosts numbered from 0 to 5 and there’s no indication which is current.
And I don’t understand why you are asking about boot time when I was telling you about turning on the drive on an already booted system. If I turn it on before booting, the drive is recognized and partitions are shown on the desktop.
I myself have been using something like this for a long time: https://icybox.de/product.php?id=182
And that without problems. The little bit of software in between probably solves your problem.
But I just wanted to throw this into the room.
|[![Post\|12x9](https://forums.gentoo.org/templates/gentoo/images/icon_minipost.gif "Post")](https://forums.gentoo.org/viewtopic-p-8499974.html?sid=410650c5d67a8cc496d46b6232a791b0#8499974)Posted: Tue Sep 15, 2020 12:32 pm Post subject: Solved - power management on SATA prevents hotplug|[![Reply with quote](https://forums.gentoo.org/templates/gentoo/images/lang_english/icon_quote.gif "Reply with quote")](https://forums.gentoo.org/posting.php?mode=quote&p=8499974&sid=410650c5d67a8cc496d46b6232a791b0)|
| --- | --- |
|I found the reason: SATA power management was active due to powertop settings which prevents hotplug to work for eSata or i guess sata in general.
Tested now with disabling all sata related toggles in powertop and once with boot without powertop settings to be called - in both cases all drives/bays where recogniced immediately.
I'm not sure which exact toggle is causing the problem (pm for controller or link power management or sth else) - will need some time to check that.
Thanks again to everyone for their ideas and suggestions. It really helped me going with the investigations.|