Re: Identifying what is accessing a USB device.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2021-03-26 at 21:46 -0600, Chris Murphy wrote:
> On Fri, Mar 26, 2021 at 5:21 PM Patrick O'Callaghan
> <pocallaghan@xxxxxxxxx> wrote:
> > 
> > I have an external USB-3 2-disk docking station, and a script which
> > can
> > power up and down the drives as needed.
> > 
> > I have a systemd automount unit that correctly powers up the dock
> > when
> > accessed, then mounts the drives (thanks Ed).
> > 
> > After an idle time, automount unmounts the drives. A script detects
> > when this happens and powers them down ... *at which point they
> > immediately power up again, and remain up until I intervene
> > manually,
> > even though they are unmounted*.
> > 
> > This never happens if I run the script directly from the command
> > line
> > (i.e. the drives power down and stay down).
> > 
> > Clearly the docking unit isn't just doing this flakily on its own.
> > Something is making it happen, and I've no idea how to discover
> > what it
> > is except that it seems to be correlated with systemd in some way.
> > 
> > All of the above is 100% reproducible.
> > 
> > I'm open to suggestions if anyone has any ideas.
> 
> smartd?
> 
> I use this line in smartd.conf to keep it from waking up the drive
> all the time.
> 
> /dev/disk/by-id/wwn-0x5000c500a93cae8a -l selftest -s L/../15/./22 -n
> standby,250
> 
> Since it's unmounted, fatrace won't work, but blktrace will..
> 
> blktrace -d /dev/sdb -o - | blkparse -i -
> 
> It will generate a lot of lines but it'll also report the process
> that's sending commands to the drive.

Just to close this off: I looked briefly at blktrace but haven´t had
the energy to follow it up (the output need a fair amount of decoding,
even with blkparse). I have since switched from MD/ext4 to BTRFS/Raid1,
and the dock now powers down the first time and doesn´t come back up
again. I´m assuming that MD was the culprit all along for some reason.

poc
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux