How to power-off a USB HDD

johannes-z

Member
Nov 22, 2022
15
1
8
Disclaimer: Linux noob here

Is there a way to power-off (and later power-on) a specific USB port? (=> for shutting down connected devices)

I just recently installed proxmox with a Ubuntu Server VM. I also use a USB HDD Case for external HDDs, which are not always needed however - I'd prefer a script I manually have to execute when I need access to the data on those HDDs, as they are kind of loud and in the middle of my living room. The Case supports a *sync* mode, where the Case shuts down if the PC it's conntected to is shut down or disconnected from USB.

I'm assuming the power-off has to come from the Host. I tried `echo '2-3' > /sys/bus/usb/drivers/usb/unbind`, which removed the usb device from the host, but the HDD Case still didn't shut down. Actually, I was even able to access the HDDs from the guest's filesystem (mounted on e.g. /media/
 
Hey,

I don't really know if there is a way to power down the USB port, but I've had a similar situation once and I solved it by unmounting the drive and then using hdparm -Y /dev/<disk> to manually power down the disk itself. Maybe that would also work in your case?
 
Hey,

I don't really know if there is a way to power down the USB port, but I've had a similar situation once and I solved it by unmounting the drive and then using hdparm -Y /dev/<disk> to manually power down the disk itself. Maybe that would also work in your case?
Thanks, I'll try that! Are you doing this on the host or guest?
 
I guess less power usage and prevent the disk from spinning.
External 3.5" HDDs usually also get way to hot when spinning 24/7.
 
Last edited:
  • Like
Reactions: johannes-z

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!