Problem with automount

Hi all,
I have just lost a 1T harddrive due to persistent mount failures.
I am running a VIM2 and had the disk mounted to the USB port on the back and a supplemental power USB attached to a separate power supply. The HDD will simply drop off, especially when I plug another disk in or even some other devise on the other USB port or even on an external USB hub. This would require a complete power off of the VIM2 to get it to come back (plugging the drive in and out did not get detected).

Things I tried -

  • two different hubs
  • both USB ports and the ports on the hub
  • a different hard drive, which exhibited the same behavior.

What I believe is happening is that the VIM2 is unable to supply adequate power through its ports (even with supplemental power), and trhe frequent power on/off’s that this causes is stressing the drive.

My question is, are other people experiencing similar issues with their boxes ? Is the VIM2 a specifically flawed design (I have read on their forums of frequent USB hub failures) ? Is Linux and Coreelec not good at automount (since this has also been my experience on other systems) making it unsuitable for USB drives ?

Looking to make some decisions about how to proceed. Do I simply replace the drive and hope for the best - or would I be better off setting up a separate NAS server and leaving the VIM2 as a KOdi front end and TVheadend server.

Thoughts.
Shoog

I’d be going down that path @Shoog.
I think any way to reduce the load from these little boxes is the best way.
The highest load ever plugged into any of my boxes is a USB thumb-drive (don’t even use them very much). My personal opinion only (no doubt, inadvertently, opening the floodgates for some heated debate from those that swear by hanging USB drives directly from every USB port - LOL)

I am coming to the conclusion that at least part off the problem is shitty substandard USB sockets, Cheap thin metal means that they flex and allow the contacts to bounce at the slightest provocation.

Shoog

Hi all, I wanted to give an update on this issue.
I think in my particular case there are multiple issues going on. Hardware is one of them but I now believe the main root cause is HDD firmware.
HDD used not to put themselves to sleep unless told to by the OS, but now they tend to have firmware power management - which unfortunately is invisible to the USB interface. So if you are using your HDD through the USB socket at some point it is likely to put itself to sleep and then the OS has no way of waking it or even knowing that it is there anymore. Hence it drops off.

What I have done, and seems to be working, is to use the Library Updater app from the Kodi repository and set it to update every hour. This hourly talk to the HDD seems to be enough to keep the HDD awake even over extended periods of dormancy.

Shoog

It probably depends on the type of HD and FW on them. I use 3 types of modern HDDs (Toshiba, Western Digital and Seagate, all 1TB) over the USB inputs on all my boxes (S905X/W, and S912) without any problem. They all have set sleep time in HD firmware and go to sleep after 10min idling (this time can be set/removed with factory settings software) Kodi wakes them up always without any problem…

I had similar problems with both my usb hard drives (1TB and 2TB). Now I have:

#!/bin/sh
(
hdparm -B 127 -S 120 /dev/sda
) &

in .config/autostart.sh and the problem is gone.

1 Like

Thanks for that, have added it to my autostart script and I will see if it helps.

Shoog

If you are going to use “hdparm” then either switch off the sleep option in HDD firmware, or make it it turn off with hdparm before HDD option kiks in.

hdparm -S 60 /dev/sda1 => spindown in 5min (sda1 => your HDD)
hdparm -S 120 /dev/sda1 => spindown in 10min

C/P
-S Set the standby (spindown) timeout for the drive. The timeout specifies how long to wait in idle (with no disk activity) before turning off the motor to save power. The value of 0 disables spindown, the values from 1 to 240 specify multiples of 5 seconds and values from 241 to 251 specify multiples of 30 minutes.

Is this related only to the VIM2 or to all CE powered boxes?

I can only say it effects the vim2

I have MX Plus S905 box and it has this problem. Even it has a 3A power supply. This problem is not only in Amlogic, also my Raspberry Pi 3 had similar problems with usb hard drive. There “hdparm -B 127” and “max_usb_current=1” helped. In my experience, you should also try different usb ports in your device.

Since this a small but significant problem for some, it might be nice to have a switch in Coreelec settings to disable sleep on HDD. This is firmly within the remit of the OS functionality.

Shoog

1 Like

I think the important option for hdparm is “-B”, which sets the “Advanced Power Management”. With that the power consumption (and the performance) is reduced. The sleep setting (-S) has no effect (to the mount-dismount problem).