Created attachment 285371 [details]
SDB SMART log
I've got an external Toshiba HDD in good conditions (USB 3.0 cable on USB 2.0 port) that I use to store backups and my work in.
Every time the system shuts down (either by terminal command or regular OS UI), the system does not wait for the hdd to park/spin down (as seen by the systemd logs), and instead, cuts the power off too early, making the disc make an acute screeching sound as if by hard power cutoff.
I believe the same thing is happening to my internal hdd (second one on linux, previous one was old and had the same problem), but I can't be sure as the sound isn't too clear.
I have reported this bug to the distribution's bug tracker (Lubuntu) and systemd, but I was requested to come here instead, as the problem must be down to the kernel.
I have tested this on Linux Mint and the same has happened. As additional information, both on Windows 10 and FreeBSD, this problem did not occur.
I'll attach smartctl logs for both HDDs. The logs say old_age and pre_fail, but this is most likely not true, as I have bought them recently and smartctl doesn't seem to be that smart at times.
I await your reply,
(In reply to Hélder from comment #0)
> I'll attach smartctl logs for both HDDs. The logs say old_age and pre_fail,
> but this is most likely not true, as I have bought them recently and
> smartctl doesn't seem to be that smart at times.
old_age and pre_fail indicate the type of the data given, they are not the result of interpreting the data. Also, one of the logs seems to be missing unless I missed something myself :)
Could you unmount (umount -v your/drive*?) and then power off the external drive manually (udisksctl power-off -b /your/drive) and see if the problem remains? You might also want to check that the drive indeed is / has remained off before shutting down (hdparm -C /your/drive).
Created attachment 285477 [details]
sudo smartctl -a /dev/sda > sda_smartctl.txt
I have just run this.
The Power-Off Retract Count seems to match the amount of times the computer has shut down without notice. I have had the internal HDD for ~3 months, perhaps. Manufacturing date is around March, if I remember correctly.
As a side note I forgot to include, the external HDD had been formatted on Windows, so, unfortunately, it is still NTFS, but I don't think this influences the problem's cause.
I have just run those commands. The disk was unmounted and visibly shutdown. The problem did not remain here, but it still does on regular shutdown.
Side note: I'm not sure if this is expected, but even when I use "shutdown -P now", systemd appears to handle it still.
Anyone? As a temporary fix, I shut down all the devices before turning the system off manually with the following code:
sudo umount -v /dev/sdb*
sudo umount -v /dev/sdc*
sudo umount -v /dev/sdd*
sudo udisksctl power-off -b /dev/sdb
sudo udisksctl power-off -b /dev/sdc
sudo udisksctl power-off -b /dev/sdd
sudo umount -v /dev/sda*
sudo udisksctl power-off -b /dev/sda
It is not a real fix, though.
Apologies for the delay. I have not had time for the research my current (and rather limited) knowledge of the matter requires :) So far I have found quite a few descriptions involving external drives but the problem certainly isn't as massive as what we've had before (https://bugzilla.kernel.org/show_bug.cgi?id=7674).
We know now that in your case the drives remain off during shutdown if turned off manually beforehand. It's not much but it's a piece of the puzzle nevertheless.
You are using usb2, I found some reports of usb3 causing this. True, I have no idea (at least off the top of my head) about the kernel version that was used in these cases. In other words, such a problem can have all kinds of causes.
But while we're at it, are you sure you are not overthinking the problem? I mean, from what I understood from your previous post, your other drive (sda) was not affected by the issue? What about the others? In order to do any bug hunting & get some knowledgeable people involved we must know exactly which drives are affected. Nailing down the basics is crucial in deciding how much attention (if any) the bug will get.
Some further questions:
You said you tested with Mint. I assume the kernel version was the same?
Could you perhaps play around some more? Try with a live version of something (different kernel), maybe even try different systems.
As for your temporary fix, I would say it's a start and during my brief research on the issue I've seen quite a few versions of it used. Perhaps convert it into a systemd service to make the process smoother. It turns out udisksctl supports unmounting too, so you could even make it look nicer if you wanted to:)
I noticed that you have filed the bug under IDE. Why? The drivers are SATA as I understand.