Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] How to power off USB hard disks without udisks?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Thu May 11, 2017 2:38 pm    Post subject: [SOLVED] How to power off USB hard disks without udisks? Reply with quote

I chose to remove sys-fs/udisks from my system because it requires polkit. Before I used the following command for powering off USB hard disks and USB flash drives:

Code:
udisksctl power-off -b /dev/sdx


How can I replace that now? I don't need any other udisks feature, just the possibility of shutting down USB devices before removing that from my computer, in order to avoid hardware/software damage. I don't even need to be able to do that from a non-privileged user since I have root access.


Last edited by fturco on Thu May 11, 2017 6:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Thu May 11, 2017 2:44 pm    Post subject: Reply with quote

USB is designed to be hotpluggable, what hardware damage you are talking about? Simple umount will guarantee all writes are completed before disconnect.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Thu May 11, 2017 4:23 pm    Post subject: Reply with quote

I'm mostly concerned about hard disk head parking. I don't want it crashing on the surface of the disk if I abruptly shut it off.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Thu May 11, 2017 4:49 pm    Post subject: Reply with quote

I think hdparm can do it, although I'm pretty sure the drive does it when powered off anyway.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Thu May 11, 2017 6:27 pm    Post subject: Reply with quote

I searched a little bit and everybody seems to agree with you: modern hard disks automatically park their heads when turned off. I guess there's no need to install an udisks replacement anymore. Thank you!
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Fri May 12, 2017 2:04 pm    Post subject: Reply with quote

I would like to do this as well. I have multiple backup drives plugged into my server, so they're spinning all the time, and I'd just as soon power them completely down until it's time for the cron job to do its thing.

I did a bit of experimentation a while back, and found that hdparm was able to spin down my Seagate drive, but the Western Digital drives wouldn't spin down. Recently I saw something about powering down a complete USB root hub through PCI-e mechanisms. Since my backup devices are all hooked through one PCE-e USB card, that method might work for me, though I haven't had time to fiddle with it yet.

Or I'm ready to be told that it's better to just leave the drives spinning full time, rather than power them up and down once a day.

I have two drives plugged in, and at night backup to the least-recently-written drive. There is also a drive in my filing cabinet at work, and every Monday and Friday I swap that drive with one of the drives from home, for off-site backup.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Fri May 12, 2017 3:35 pm    Post subject: Reply with quote

depontius,

With modern external HDDs I don't think it matters whether or not you leave them powered on all the the time via the USB bus. For example, the official Western Digital position is stated in their Answer 1386:

Western Digital wrote:
Leaving an external hard drive powered on all the time

Answer ID 1386

Western Digital recommends that external hard drives be powered off when not in use, although it is safe to leave a hard drive running continuously. The hard drive should be placed away from any electronic devices and in a well ventilated area to allow airflow to the hard drive. Western Digital also recommends that the drive's power supply is connected through a surge protector. In the case of a power surge, or brown/black out, the hard drive's sensitive electrical components will not be damaged.

The initial power-on process is generally harder on the internal components of a hard drive than spinning for extended periods. However, Western Digital drives are designed to handle either scenario. Most users outgrow their drive before repeated turning on and off becomes a problem. Turning on the drive a few times per day is considered normal usage and should not pose any problems. If a drive is turned on and off excessively on a daily basis, this could affect the longevity of the hard drive’s components.

_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri May 12, 2017 4:21 pm    Post subject: Reply with quote

For spindown there is sdparm, maybe it works better then hdparm with WD drives, also there is sys-apps/idle3-tools to set the timing.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum