HDD strange behaviour

Issues Related to Hardware (Sound, Video, Printers, Scanners, Webcams, Touchpads, Keyboards, Sensors, Drives, GRUB, etc.)

Moderator: Moderators

msdobrescu
Old Dear Hen
Posts: 713
Joined: Sun Aug 21, 2011 8:48

HDD strange behaviour

Post by msdobrescu » Sun Jan 27, 2019 19:24

Hello,

I have several hard disks in an USB enclosure. They are WD Grren type, all set the parking times to 300.
Still, they behave differently.
Some I could let them online, they are available no matter when I access them or after how long I access them.
One, especially, goes to sleep very fast.
At that point, if I try to access it, weather read or write, the system enters in a busy state.
First, I have suspected some bad blocks, so I have started to check, using badblocks in a non destructive scan.
After an hour it looked stalled. As it is not the first time I deal with dying disks, I thought it has found some bad blocks.
To my amazement, although I have expected it to keep the disk active, it didn't. The disk was actually in sleep mode, as reported everywhere, mostly visible in the system monitor. So, no matter what, the disk goes to sleep.
Also, it is not possible to unmount and eject it, no matter how long I wait, I could not bring it back unless the system is forcibly restarted, and the enclosure too.
The system displays a core used 100% by the process trying to read or write on the disk.
D-bus reports to be out of resources, so mounting another disk is impossible.
I use KDE, so Dolphin is stalled too, regardless running badblocks in console.
Other KDE apps try to start or do their job, but they remain blocked, even painting is not possible anymore.
I have the files manager from Gnome too (it seems to handle some file names better than Dolphin, I have used it in the past especially when characters that are not in the current encoding are used in the files names, Dolphin being unable to access them). This file manager starts fine and works also fine!
VLC works too. Also Firefox. I can start anbd stop and start them successfully.

Does anybody know what happens? Or at least some clue?

Thanks in advance!

User avatar
Fitzcarraldo
Sagely Hen
Posts: 8186
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: HDD strange behaviour

Post by Fitzcarraldo » Mon Jan 28, 2019 18:05

msdobrescu wrote:One, especially, goes to sleep very fast.
What happens if you only have that one drive in the enclosure?

msdobrescu
Old Dear Hen
Posts: 713
Joined: Sun Aug 21, 2011 8:48

Re: HDD strange behaviour

Post by msdobrescu » Mon Jan 28, 2019 20:32

Hi, I've built the enclosure (I have two). The disk is going to sleep, regardless the number of disks. They all are plugged into an sata - USB adapter and extender that allows 5 disks at most.
Some WD Green disks are this way. The weird thing I've found now is I can power on the enclosure, wait as long as I want (12 hours today) and mount the disk. It sleeps after a while. Probably that is the moment I comes online, works a while, then goes to sleep.
But I don't understand what causes the 100% usage of a core trying to ... do something with it.
I don't understand the KDE apps that become frozen while GTK/Gnome based ones work fine. Looks to be by KDE vs Gnome/GTK design...

User avatar
Fitzcarraldo
Sagely Hen
Posts: 8186
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: HDD strange behaviour

Post by Fitzcarraldo » Tue Jan 29, 2019 13:13

You could login to KDE Plasma 5, install sys-apps/gsmartcontrol using Equo then use GSmartControl GUI to check the settings of each drive, and also use GSmartControl to run an extended test on the drives to see if any differences are reported. The only other thing I can suggest would be to install hdparm and use it to check the current setting and adjust it -- see the Arch Linux Wiki article https://wiki.archlinux.org/index.php/Hdparm and especially the section in it regarding Western Digital Green drives.

msdobrescu
Old Dear Hen
Posts: 713
Joined: Sun Aug 21, 2011 8:48

Re: HDD strange behaviour

Post by msdobrescu » Tue Jan 29, 2019 13:20

Thanks, I have already run hdparm -J and they seem to have the same setting.

User avatar
Fitzcarraldo
Sagely Hen
Posts: 8186
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: HDD strange behaviour

Post by Fitzcarraldo » Tue Jan 29, 2019 19:31

Did you also try the idle3ctl command?: http://idle3-tools.sourceforge.net/

msdobrescu
Old Dear Hen
Posts: 713
Joined: Sun Aug 21, 2011 8:48

Re: HDD strange behaviour

Post by msdobrescu » Tue Jan 29, 2019 19:49

I have booted in free dos and used WD's tool, it displays the same values as hdparm -J.

msdobrescu
Old Dear Hen
Posts: 713
Joined: Sun Aug 21, 2011 8:48

Re: HDD strange behaviour

Post by msdobrescu » Sun Feb 03, 2019 20:50

I have found some behaviour that I think is a bug. I have added a request to KDE too.
For external drives, connectable by USB, at least, the Device notifier has a problem, IMHO.
In the past, external drives could have been ejected, that being actually an unmount. Seems that did not flush disks buffers, and data was lost sometimes when powered down (manually). Also, they could have been unplugged manually, with similar results.
That has been improved by checking and refusing the eject request from the Device notifier. Now, when busy, it is rejected, but when it's possible, the disks are ejected and powered down, with heads parked. But it is impossible to mount them again unless they are unplugged and plugged again. This is so annoying. Also, if some enclosure allows multiple disks inside, ejecting a disk will lose the opportunity to mount other disk from that enclosure, unless it is unplugged and plugged again, because the disks are turned off.
What I don't understand is why is not possible to unmount the disks and flush the buffers only, allowing to remount them until the user decides to turn them off.. This means two buttons instead of one.

What do you think?

Anyway, when a disk goes to sleep, the problem of not being able to complete the eject and power down procedure persists and the OS tries to do this indefinitely at shutdown when a regular shutdown is requested (means no forcing or skipping disk operations at shutdown time).

User avatar
Fitzcarraldo
Sagely Hen
Posts: 8186
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom
Contact:

Re: HDD strange behaviour

Post by Fitzcarraldo » Mon Feb 04, 2019 1:37

KDE Device Notifier can be annoying sometimes. The problem is that clicking on the Eject icon in Device Notifier (tooltip 'Click to safely remove this device') both unmounts and ejects the device (two separate commands). Of course, in the case of a USB device the device remains physically connected until you pull out the USB plug. However, there is a hack that can help. Firstly, note that it is possible to mount and unmount drives by using the 'udisksctl' command. For example, consider one of my USB HDDs which has the label 'USBHDD01' (I assign a label to all HDD partitions, be they on internal HDDs or on external HDDs/pendrives). It is possible to unmount the specific USB device and remount it by using the following commands:

Code: Select all

$ udisksctl unmount -b /dev/disk/by-label/USBHDD01
Unmounted /dev/sdb1.

Code: Select all

$ udisksctl mount -b /dev/disk/by-label/USBHDD01
Mounted /dev/sdb1 at /run/media/fitzcarraldo/USBHDD01.
In both the above cases the USB device remains displayed in Device Notifier. I have created a couple of executable Desktop Configuration Files in ~/Desktop which I can double-click to run each of the above commands. I have given each of them an appropriate icon:

Code: Select all

$ cat Mount_USBHDD01.desktop 
[Desktop Entry]
Comment[en_GB]=Mount USB HDD with label USBHDD01
Comment=Mount USB HDD with label USBHDD01
Exec=udisksctl mount -b /dev/disk/by-label/USBHDD01
GenericName[en_GB]=Mount_USBHDD01
GenericName=Mount_USBHDD01
Icon=media-mount
MimeType=
Name[en_GB]=Mount_USBHDD01
Name=Mount_USBHDD01
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=fitzcarraldo

Code: Select all

$ cat Unmount_USBHDD01.desktop 
[Desktop Entry]
Comment[en_GB]=Unmount USB HDD with label USBHDD01
Comment=Unmount USB HDD with label USBHDD01
Exec=udisksctl unmount -b /dev/disk/by-label/USBHDD01
GenericName[en_GB]=Unmount_USBHDD01
GenericName=Unmount_USBHDD01
Icon=media-eject
MimeType=
Name[en_GB]=Unmount_USBHDD01
Name=Unmount_USBHDD01
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=fitzcarraldo
(N.B. Since I could not find a media-unmount icon, I have used the media-eject icon to represent Unmount.)

This approach is not perfect in the sense that the device will still disappear from Device Notifier if you do click on the Eject icon in Device Notifier. But at least I can avoid doing that until I really do want to unplug the device from my laptop. In other cases I simply double-click on the Unmount_USBHDD01 icon and Mount_USBHDD01 icon on my desktop to unmount and re-mount the USB HDD, respectively. In each case Device Ntofier shows the correct state of the device.

msdobrescu
Old Dear Hen
Posts: 713
Joined: Sun Aug 21, 2011 8:48

Re: HDD strange behaviour

Post by msdobrescu » Mon Feb 04, 2019 9:29

Hi, thank you for the tricks, but I'd prefer to ask KDE team for a resolution.
I have added a KDE request here: https://bugs.kde.org/show_bug.cgi?id=402660.
Still, just unmounting risks to miss flushing the buffers,isn't it?

Post Reply