You are not logged in.

#1 2020-12-06 20:55:10

zcal
Member
Registered: 2010-01-13
Posts: 57

[SOLVED] USB hard drive not parking heads on poweroff

I added a USB hard drive to my system and have noticed that it appears not to be parking the heads on system shutdown; I can hear a brief scrape when the power is cut.  The drive is encrypted, and I automount it at boot with crypttab and fstab entries.  I shut down the system by issuing the poweroff command.

The Wiki recommends explicitly telling the system to shut down USB drives after unmounting them.  I could certainly script unmounting, closing my LUKS container, shutting down the drive, and then powering off the system, but shouldn't I be concerned that systemd does not appear to already be handling this for me?  What's more, if my USB drive isn't properly being powered down, can I expect that my main SSD connected via SATA is?

Last edited by zcal (2020-12-20 05:39:46)

Offline

#2 2020-12-20 05:39:29

zcal
Member
Registered: 2010-01-13
Posts: 57

Re: [SOLVED] USB hard drive not parking heads on poweroff

After doing some scripting to shut down the drive prior to poweroff, it appears that the issue is likely with the time it takes the drive to realize it's been cut loose from the system and park its heads.  I've had to implement a 20 second sleep between telling the system to delete the drive and poweroff.  Anything less and I still get the scrape sound.

Offline

#3 2020-12-20 15:39:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED] USB hard drive not parking heads on poweroff

I am skeptical that it truly the heads scraping across the disk.  I cannot think of any drives built in this century that do not automatically park their hands at removal of power. 
https://superuser.com/questions/1319383 … -shut-down
https://en.wikipedia.org/wiki/Hard_disk_drive_failure
.
But, you probably do want to ensure the volume is dismounted and the drive sync'ed (see man sync).  Some old timers will run it a few times, just be to sure wink https://utcc.utoronto.ca/~cks/space/blo … gendOfSync


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2020-12-20 20:02:43

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] USB hard drive not parking heads on poweroff

The emergency retract is probably just less controlled and smooth as a regular one (but unlikely to crash on the discs - the parking is the default position and requries power to be pushed out)
Try to umount the drive (what should™ sync it implicitly) and the "hdparm -y /dev/sdX" to move it to standby - currently you're probably relying on the standby timeout.

Offline

#5 2020-12-27 21:30:46

zcal
Member
Registered: 2010-01-13
Posts: 57

Re: [SOLVED] USB hard drive not parking heads on poweroff

I did consider that the sound could be the drive auto-parking the heads at power loss.  If it's that, then it's noisier than I expected so it's alarming.

The suggested hdparm command yields the following:

SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

This points to firmware issues and specifically mentions Seagate drives, which is what I have.

A 20 second delay on shutdown isn't the worst, so I'm inclined to just keep my script as-is.  If it starts to bug me anymore I'll probably bite the bullet and buy an SSD to replace it.  tongue

Offline

#6 2020-12-27 21:51:47

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] USB hard drive not parking heads on poweroff

Did you see the comment about the quirk situation?

Offline

#7 2021-01-10 21:02:25

zcal
Member
Registered: 2010-01-13
Posts: 57

Re: [SOLVED] USB hard drive not parking heads on poweroff

I didn't.  Glossed over it.  tongue

I've disabled quirks for the drive and now it's accepting the hdparm standby command.  Much better.  Thanks for pointing that out!

Offline

Board footer

Powered by FluxBB