On Fri, 2021-03-12 at 22:39 +0800, Ed Greshko wrote:
> > > Does something need running when the share goes from unmounted to
> > > mounted?
> > Just a timer. Once it's powered up and mounted, it should stay that
> > way
> > until an idle timeout is triggered.
> 
> That statement confuses me.  Isn't that what happens with automount
> and the TimeoutIdleSec=
> parameter?

The automount correctly unmounts the drive. That isn't the problem. The
problem is in getting the drive to power down after it has been
unmounted. This means invoking a script.

The power-up script does this:
echo "- - -" > $SCAN

where SCAN is set to /sys/class/scsi_host/host7/scan. The host number
can change (but seems fairly stable in practice), so this is not robust
in itself). The "- - -" string is pure black magic I found with a
Google search. I have no idea what it means but it does work.

The power-down script does this:

echo 1 > /sys/block/$SLOT1/device/delete
where SLOT is sd<N>

Note that "udisksctl power-off ..." is not an option (I tested it)
because that deletes the kernel's knowledge of the bus, meaning it
can't be powered on again. I'm fairly sure I asked about this some
months ago but didn't get a useful answer.

Of course it's possible that sending some command to the dock would
power down the drives, but the thing has no useful documentation. It
just comes with (of course) a Windows driver.

> [...]

> Well, I suppose I understand (sort of) my confusion.  I don't know
> what "disconnection" means.

The only way to get the drive to power down is by programmatically
disconnecting it from USB, as above.

> And, I don't know why a script is needed to unmount if that is
> handled by automount and its timeout.

It isn't needed to unmount. It's needed to power down after unmounting.

> Not that it matters, but if my NAS died I'd just go out and replace
> it.  :-)

That's a valid option of course, but as I already have the hardware I
need I dislike spending the money unnecessarily. Call it a hobby
project.

poc
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to