My LE 8.2 running on odroid c2 keeps hanging every now and then. I believe the root cause is the USB hard drive going into sleep and then not waking up in a timely manner and failing. A reboot usually fixes the issue. But off late this has started happening almost daily.
When I SSH and try to access a folder on the hard drive via 'ls' command or any other way, that SSH session hangs too. Even Ctrl+C does not help. I have to disconnect session and reconnect. My SSH session works as long as I stay away from accessing anything on the HDD.
Here is the log entries from "journalctl -r" that makes me believe the problem is due to Hard drive:
Oct 12 11:50:58 libreElec kernel: EXT4-fs warning (device sda1): __ext4_read_dirblock:901: error reading directory block (ino 9
306186, block 0)
Oct 12 11:50:58 libreElec kernel: end_request: I/O error, dev sda, sector 297863464
Oct 12 11:50:58 libreElec kernel: cdb[0]=0x88: 88 00 00 00 00 00 11 c1 09 28 00 00 00 08 00 00
Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda] CDB:
Oct 12 11:50:58 libreElec kernel: ASC=0x44 <<vendor>> ASCQ=0x81
Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda]
Oct 12 11:50:58 libreElec kernel: Sense Key : 0x4 [current]
Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda]
Oct 12 11:50:58 libreElec kernel: Result: hostbyte=0x00 driverbyte=0x08
Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda]
Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: [sda] Unhandled sense code
Oct 12 11:50:58 libreElec kernel: sd 0:0:0:0: timing out command, waited 180s
Two questions:
- How do I disable USB auto-suspend for hard drives and make it persist after reboots.
- Is there any way to recover from the errors suggested in logs without reboot ? such as restarting a service or remounting hard drive ?
Ideally, I would want the hard drives to spin down only at night. But that is assuming that it will come back up day after day without these errors.
Please advice. Thanks in advance.