spin-down
First you need to find the sysfs path to your device ( e.g. using lsusb)
If the full path to the USB device's sysfs node is:
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13.2/1-13.2.1/
udisksctl power-off -b /dev/sdz
does something very much like:
hdparm -Y /dev/sdz
echo 1 > /sys/block/sdz/device/delete
echo 1 > /sys/devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13.2/1-13.2.1/remove
( to improve the behaviour in scripts you might use /dev/disk/by-id/thingy-name01234 instead of /dev/sdz)
which then removes the:
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13.2/1-13.2.1/
directory altogether.
The parent device:
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13.2/
represents the USB port itself, and this is now in that "disabled" state.
To to reset this:
you can tell it to change which USB configuration it should use, and in order to use that configuration it needs to reset everything.
Telling it to use the same configuration it's currently in should reset it as well:
# cat /sys/devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13.2/bConfigurationValue
1
# echo 1 >/sys/devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13.2/bConfigurationValue
With that, the port is re-enabled just as if I'd plugged in the device again (i.e. the .../1-13.2.1 subdirectory reappears, the device on the port is probed, the kernel discovers a USB storage device there, and so on).
Rescan
And then to (re)scan, e.g. to see a newly connected device if it's not automatically found, or to again see something that was "deleted" as above, e.g.:
# (for tmp in /sys/class/scsi_host/host*/scan; do echo '- - -' >> "$tmp"; done)
Resetting
to just reset a device:
for X in /sys/bus/usb/devices/*; do
echo "$X"
cat "$X/idVendor" 2>/dev/null
cat "$X/idProduct" 2>/dev/null
echo
done
to list them , then use
sudo sh -c "echo 0 > /sys/bus/usb/devices/1-4.6/authorized"
sudo sh -c "echo 1 > /sys/bus/usb/devices/1-4.6/authorized"
to reset it
Enabling smart on usb devices
if you cannot get smart values ,
$ lsusb | grep -i seagate
Bus 003 Device 004: ID 0bd1:2027 Seagate RSS LLC Expansion HDD
https://www.reddit.com/r/linuxquestions/comments/r34j7j/running_udisksctl_poweroff_b_devsdx_disables_usb/