HD wakeup from powersave

Post Reply
User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

HD wakeup from powersave

Unread post by hfb » Tue Jun 21, 2016 3:52 am

Hello All,

My system is idle, but frequently my USB3-disk spins up. Before reaching full speed it is again set to powersave and stops running (that is, what I hear).

What is the explanation for this and how can I prevent my disk from geting these unnecessary power ups?

Thanks
hfb
Last edited by hfb on Sun Jan 22, 2017 2:19 am, edited 2 times in total.

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HD wakeup from powersave

Unread post by odroid » Tue Jun 21, 2016 11:17 am

Was there any clue in dmesg or other log file when the HDD ran again?

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Thu Jun 23, 2016 6:23 am

did not check dmesg when it happened. Will pay attention next time it happens. Kernellog does not show anything when looking for "sda events" besides those on system startup.

hfb

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Sat Jun 25, 2016 11:37 pm

Currently it seems, that the USB3-drive does not go into powersave (spin down) any longer. I had some other problem loosing LAN and applied a blacklist entry into /etc/default/tip according to the reply I got for that posting. As I remebmer I read something about the hardware, that the LAN port is attached to an USB3 connection. If the according device ID 0bda:8153 is the same for the external USB3 ports, these also will be excluded from powersave state by this blacklist entry. Is that possible?

The following last line in the code-box indicates, that the drive is in standby!?

Code: Select all

$ cat /var/log/syslog |grep sda
Jun 25 16:11:43 bcksrvr smartd[662]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 76 to 70
Jun 25 16:11:43 bcksrvr smartd[662]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 24 to 30
Jun 25 16:14:28 bcksrvr smartd[662]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 70 to 69
Jun 25 16:14:28 bcksrvr smartd[662]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 30 to 31
Jun 25 16:44:32 bcksrvr smartd[662]: Device: /dev/sda [SAT], is in STANDBY mode, suspending checks

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Wed Jun 29, 2016 12:43 am

Update
This is what I found in /var/log/syslog when it just happened that my USB3 was spinned up and turned down while not having reached full speed.

Code: Select all

Jun 28 17:17:01 bcksrvr rsyslogd-2007: action 'action 9' suspended, next retry is Tue Jun 28 17:18:01 2016 [v8.12.0 try http://www.rsyslog.com/e/2007 ]
Jun 28 17:17:01 bcksrvr CRON[2384]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Jun 28 17:32:36 bcksrvr rsyslogd-2007: action 'action 9' suspended, next retry is Tue Jun 28 17:33:36 2016 [v8.12.0 try http://www.rsyslog.com/e/2007 ]
ro
At 17:17 there was no spin up, only at 17:32

demsg did not indicate anything related to disk

As I had installed the latest kernel (now 3.10.96-86) one day after my original posting I had thought that this had solved my problem (did not detect the drive spinning up until now.

Hope my infos helps to find the reason for this behavior.

hfb

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HD wakeup from powersave

Unread post by odroid » Wed Jun 29, 2016 9:48 am

It is very hard to find a root cause. :(
I think USB host or USB hub power management have something wrong.

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Wed Jul 06, 2016 12:08 am

Hello odroid,

I agree, but there may be involved some more activities. The above given messages in syslog are different, when the drive is not suspended. Then there are messages about temperature of the drive. To me that there is some process retrieving info about health of the drive via SMART in about every 15 minutes. But why the drive is awakened not every time, this I think is problem of USB powermanagement.

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HD wakeup from powersave

Unread post by odroid » Wed Jul 06, 2016 10:31 am

Recently we've fixed the LPM issue in the USB 3.0 host driver.
We have a plan to release a Ubuntu 16.04 LTS image in a couple of weeks.
If possible, please test this issue when the new OS image is released.

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Mon Aug 01, 2016 12:48 am

Today I tried to avoid this issue by having the drive unmounted normally. It is used by some backup scripts only. I modified the scripts to mount/dismount in beginning/end of the scripts.

This does make no difference. The drive spins up even when not mounted. So I returned to the former version of my scripts and hve the drive mounted all the time.

I hope the 16.04 version of the OS will cover this problem.

hfb

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HD wakeup from powersave

Unread post by odroid » Tue Aug 02, 2016 1:42 pm

Sorry. I forgot this thread.
The LPM fix had a serious negative side effect and we couldn't include it in 16.04 release.
Once we enabled the LPM, the USB 3.0 hub port kept disabling/enabling very frequently and it caused very heavy CPU load.
We will look into the issue again. Sorry about that. :(

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Wed Jan 04, 2017 3:43 am

New information
I upgraded to 16.04 and due to some problem I issued journalctl
The last entries show, that the system asks every 30 minutes for the temperature of the drive. It may be a firmware problem or chip design error, that this leads for my drive to spin up and return to sleep immediately after the requests, but to avoid this powercycles which stress the drive, I would like to stop these requests on OS level. Who has information where to do this?
hfb

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Wed Jan 04, 2017 3:49 am

Most likely smartmontools/hdparm or a monitoring tool has a daemon that runs in backdround (or gets called by cron). I'm also interested in this to limit hdd stress. Does journalctl report anything for that time interval?

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Wed Jan 04, 2017 6:38 am

My /etc/smartmontools/... does not containe any script checking disk temps.
My systemwide crontab /etc/crontab only calls the daily, weekly, monthly crontask
My root crontab ist empty an nonroot users are not allowd to X hdparm as far as I know.

Mostly journalctl shows no other entries, but there were some when eth0 was waked up, This means I started to use the machine after having paused. Then there are 2 messages according read errors. This happened when my backujob was running. It reads the fullbackup to only transfer newer files from remote machines. Here some lines containing these errors

Code: Select all

n 03 17:28:13 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 62 to 65
Jan 03 17:28:13 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 38 to 35
Jan 03 17:58:12 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 65 to 66
Jan 03 17:58:12 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 35 to 34
Jan 03 18:28:05 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 66 to 62
Jan 03 18:28:05 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 34 to 38
Jan 03 18:58:12 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 62 to 65
Jan 03 18:58:12 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 38 to 35
Jan 03 19:28:13 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 65 to 66
Jan 03 19:28:13 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 35 to 34
Jan 03 19:58:05 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 113 to 115
Jan 03 19:58:05 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 66 to 62
Jan 03 19:58:05 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 34 to 38
Jan 03 20:28:05 bcksrv smartd[673]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 115 to 117
What HD are you using. Mine uses ASMedia chips. If yours has some other chip, then this behaviour is not a device problem. perhaps some general fault in the USB specifications (This behaviour is independant where the drive is connected, to USB3 or 2).
Repetition of the HD behaviour:
The disk spins up every 30 min and before reaching full speed spins down again.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Wed Jan 04, 2017 1:34 pm

What about smartd? It sounds like it runs as a daemon.
How do I find out my HDDs USB controller? By googling?

Edit: For me, smartd tries to collect such information from my disks, but my disk requires the use of "-d sat" and thus isn't queried.

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Wed Jan 04, 2017 9:56 pm

How do I find out my HDDs USB controller? By googling?
lsusb shows it with me

Code: Select all

 Bus 004 Device 003: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge
If not displayed with you try googling with the USB ID, but vendor ID 55aa is ASMedia

smartd should have some conf-file. I had looked for that too, but not yet found
my disk requires the use of "-d sat" and thus isn't queried.
Where you must use that option
What do you mean with "is not queried"? Do you not find the temperature lines in your journalctl ouptut?

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Wed Jan 04, 2017 10:18 pm

lsusb shows it's a seagate disk - so it must have its own controller. I've ordered an ASMedia based bridge for my big HDD, so I'll find out next week or so.

Code: Select all

Bus 002 Device 003: ID 0bc2:ab05 Seagate RSS LLC
I haven't looked into how smartd reads its config (which is /etc/smartd.conf), but you can query it by hand with:

Code: Select all

smartctl -d sat -a /dev/sda
My smartd instance is not working (but I'm not going to use it anyway):

Code: Select all

root@aldebarano:~# sudo service smartd status
_ smartd.service - Self Monitoring and Reporting Technology (SMART) Daemon
   Loaded: loaded (/lib/systemd/system/smartd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-01-04 12:54:05 EET; 2h 24min ago
     Docs: man:smartd(8)
           man:smartd.conf(5)
 Main PID: 24417 (code=exited, status=17)

Jan 04 12:54:05 aldebarano smartd[24417]: smartd 6.5 2016-05-07 r4318 [armv7l-linux-4.9.0-dmole-memeka-7-merged-ge9b1eb2] (local build)
Jan 04 12:54:05 aldebarano smartd[24417]: Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
Jan 04 12:54:05 aldebarano smartd[24417]: Opened configuration file /etc/smartd.conf
Jan 04 12:54:05 aldebarano smartd[24417]: Drive: DEVICESCAN, implied '-a' Directive on line 23 of file /etc/smartd.conf
Jan 04 12:54:05 aldebarano smartd[24417]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Jan 04 12:54:05 aldebarano smartd[24417]: DEVICESCAN failed: glob(3) aborted matching pattern /dev/discs/disc*
Jan 04 12:54:05 aldebarano smartd[24417]: In the system's table of devices NO devices found to scan
Jan 04 12:54:05 aldebarano systemd[1]: smartd.service: Main process exited, code=exited, status=17/n/a
Jan 04 12:54:05 aldebarano systemd[1]: smartd.service: Unit entered failed state.
Jan 04 12:54:05 aldebarano systemd[1]: smartd.service: Failed with result 'exit-code'.

The problem is /dev/discs doesn't exist for me.

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Wed Jan 04, 2017 11:02 pm

Just read man smartd.conf
DEVICESCAN failed: glob(3) aborted matching pattern /dev/discs/disc*
"DEVICESCAN" means a list is generated/read to check all drives. This leads to errors for you.
So comment the line and add your device(s) line by line
I just commented this line in my conf-file and added a new line
/dev/sda -n standby

Doku says it apllies to ATA drives only but "smartctl -t auto /dev/sda" reports ATA. If the spinup/down is avoided now, we will see shortly.

Other chance is, to disable checking for certain drives. For me, there is only that one as standard and I think, the developers should have taken care of temperatures based on every ambient temps in summer at europe. Of course, other errors of my drive will not be detected I fear (like the prefailure in my yesterday journalctl snipet). So I would prefer to not disable the checks completely. But the conf file gives examples how to disable temperature checks.

At least it should be possible, to increase the interval of the checks but until now I only found a starting option for smartd for that. I am looking for smartctl to have an option for that.


EDIT:
Now it's 15:05 at my place Last temp entry in journalctl was at 14:29, but after modifying my smartd.conf I restarted smartd at 14:31. Therefore I would have expected a new spinup at 15:01/02 but did not hear anything. and up to the time given above there is no entry displayed by journalctl.
This would be greate, but I will control after anoother 30 min.

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Wed Jan 04, 2017 11:47 pm

For me the problem is solved. There are no more "Temperature" entries displayed by journalctl for the last 90 minutes and I heared no spinup/down of my disk.

But what about you mad-ady.

Is it possible, to allow marking the thread as solved to you?

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Thu Jan 05, 2017 1:11 am

I'll need more time to check. Unfortunately my disk is small and it's quite hard to hear it start up (I can feel some extra vibration though). I'll take it with me and test it tomorrow.
Some questions/ideas:
1. You could have smartd check the disk status less often (e.g. once a day) and do a full check
2. So, do you conclude that reading temperatures with either smartctl or smartd causes the disk to needlessly spin up? I could live with no temperature checking.
3. Does start/stop count dirrectly correlate with spin up/down, or is it for power on?
4. Does power-on-hours increment when the disk is spun down?

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Thu Jan 05, 2017 1:30 am

1. You could have smartd check the disk status less often (e.g. once a day) and do a full check
There is a start option for smartd, but as standard smartd is started on boot, where to add this option. Still not found another solution for that.
2. So, do you conclude that reading temperatures with either smartctl or smartd causes the disk to needlessly spin up? I could live with no temperature checking.
This is possible too. Have a look at the man page for smartd.conf. They supply examples to disable temperature checks. But my solution is the better one, to inhibit checks, if the disk is in powersave . I think I remember some place (but where?), that gave a smartctl command
$ smartctl -n standby /dev/sdX
Otherwise direct entry in the conf file like I did and restart smartd (sudo systemctl restart smartd)

3. & 4. I don't now.
Unfortunately my disk is small and it's quite hard to hear
Don't you find the entries concerning disk temperature in your output of journalctl? Simply
sudo journalctl |grep Temp (capital letter T !!)

For me the current behaviour leads to NO checks at all. My machine is a Backup-server collecting backups from different remote machines and the over all time to do that is less than 30 minutes. The standard job is currently started manually, so only by accident the smartd check would meet the time, where the disk is spun up. Butt there is a regular job running every 3 hours. There I could include a command for a complete health check of the disk via smartctl.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Thu Jan 05, 2017 10:25 pm

I've tested a bit and I came to mixed conclusions.
1. The HDD connected to the XU4 reports about 40C when idle:

Code: Select all

194 Temperature_Celsius     0x0022   040   051   000    Old_age   Always       -       40 (0 19 0 0 0)
2. The HDD connected to the old NAS via USB2, or to my PC via USB3 idles at around 32C:

Code: Select all

194 Temperature_Celsius     0x0022   033   051   000    Old_age   Always       -       33 (0 19 0 0)
3. Reading SMART attributes via smartctl seems to cause disk activity (I can hear a wheezing and some clicking when I run the command)
4. Even more disturbingly, when I try to force the disk to shutdown with sudo sdparm -C stop /dev/sdd I hear disk activity and the disk doesn't go to a low power mode.
5. I've tried with hdparm hdparm -S 1 /dev/sdd and the disk goes to sleep (I can't hear any mechanical noises from inside) after 5 seconds. Yay! Reading SMART spins up the disk - BOO! Reading SMART with "-n standby" tells me the disk is in standby - at least I can find out without listening the disk - Yay!

Code: Select all

sudo smartctl -d sat -n standby -a /dev/sdd
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-53-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Device is in STANDBY mode, exit(2)

I still need to measure if Power_On_Hours increments when the disk is in standby or not, but at least I can see when standby is active (and it doesn't spin up).

So, now what's left for me is to plug the disk back into the XU4 (I did my tests on my PC) and:
1. run hdparm, but disable sdparm/hd-idle and any monitoring script which wants to read temperature
2. Test periodically to see if the disk is in standby with smartctl
3. Read the temperature after a long standby period to see if its around 33C, which seems to be the normal baseline.

You can mark the thread as solved, and I'll keep posting my findings.

P.S. My main 3.5" 3TB "Green" drive that runs in my old NAS reports a temperature of 55C. So, It's about time to move it someplace cooler.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: [SOLVED] HD wakeup from powersave

Unread post by mad_ady » Fri Jan 06, 2017 3:45 am

Update: hdparm works nicely on my xu4. The disk goes to sleep and is kept at a cool 33C. I need to work on writing a udev rule to run hdparm after insertion to account for mobility

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: [SOLVED] HD wakeup from powersave

Unread post by odroid » Fri Jan 06, 2017 10:27 am

Good to hear you found a solution. :D
BTW, which kernel version do you use now?

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: [SOLVED] HD wakeup from powersave

Unread post by mad_ady » Fri Jan 06, 2017 1:01 pm

I'm personally using 4.9 (dmole-memeka branch from the linux-next thread), but it shouldn't make a difference

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: [SOLVED] HD wakeup from powersave

Unread post by odroid » Fri Jan 06, 2017 2:43 pm

I see. Do you have any issue with USB 3.0 devices hotplug on Kernel 4.9?
Sorry for my out of topic.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: [SOLVED] HD wakeup from powersave

Unread post by mad_ady » Fri Jan 06, 2017 4:28 pm

Well, yes... sometimes it doesn't see the device and I get some bus resets in dmesg. It works after a reboot though.

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: [SOLVED] HD wakeup from powersave

Unread post by odroid » Fri Jan 06, 2017 5:01 pm

Thank you for the answer.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: [SOLVED] HD wakeup from powersave

Unread post by mad_ady » Fri Jan 06, 2017 8:28 pm

Here is how to add hdparm to a specific disk via udev:

Code: Select all

$ sudo vi /etc/udev/rules.d/90-disk.rules
ACTION=="add", ENV{DEVNAME}=="/dev/sd?", SUBSYSTEM=="block", ENV{ID_SERIAL_SHORT}=="575844314141305636323937", RUN+="/sbin/hdparm -S 120 $env{DEVNAME}"
$ sudo udevadm control -R
This runs the hdparm command when I plug in the disk with the serial number 575844314141305636323937. You can find out the HDD's serial number with dmesg:

Code: Select all

[1885221.800435] usb 4-1.3: Product: My Passport 0730
[1885221.800436] usb 4-1.3: Manufacturer: Western Digital
[1885221.800437] usb 4-1.3: SerialNumber: 575844314141305636323937

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Sun Jan 22, 2017 2:30 am

I had to remove the "solved" for detection of frequent powerup/downs like before. But now they are not in fixed intervalss of 30 min.
I found this info in syslog

Code: Select all

Jan 21 17:28:05 bcksrv smartd[761]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 31 to 36
Jan 21 17:53:15 bcksrv kernel: [ 4786.747684] [c1] NOHZ: local_softirq_pending 08
Jan 21 17:53:15 bcksrv rsyslogd-2007: action 'action 10' suspended, next retry is Sat Jan 21 17:54:45 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jan 21 17:58:10 bcksrv smartd[761]: Device: /dev/sda [SAT], is in STANDBY mode, suspending checks
Jan 21 17:58:10 bcksrv rsyslogd-2007: action 'action 10' suspended, next retry is Sat Jan 21 17:59:40 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jan 21 18:05:12 bcksrv kernel: [ 5503.626049] [c1] NOHZ: local_softirq_pending 08
Jan 21 18:05:12 bcksrv rsyslogd-2007: action 'action 10' suspended, next retry is Sat Jan 21 18:06:42 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jan 21 18:16:02 bcksrv rsyslogd-2007: action 'action 10' suspended, next retry is Sat Jan 21 18:17:32 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jan 21 18:17:01 bcksrv CRON[4133]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Jan 21 18:23:09 bcksrv rsyslogd-2007: action 'action 10' suspended, next retry is Sat Jan 21 18:24:39 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
No idea what smartd is looking for and why wake up happens sometimes, sometimes not. As mentioned in some earlier post I modified it's config to not wake up drives. The 1st line shown above happened at the end of my dayly buckup run. The drive was not in powersave then. The drive was waked up with the last entry 18:23:09, but of course nothing in this entry says anything about my drive.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Mon Feb 06, 2017 7:07 pm

Ok, I'm rejoining the discussion. This weekend I managed to find the time to port my old 3TB WD Green disk from my old NAS to the XU4. I sorted out the initial issues and I'm now left with only one big issue - the drive never spins down.
First of all - this disk does not support sudo hdparm -S 1 /dev/sdb. It doesn't complain, but doesn't spin down the disk. But sudo hdparm -y /dev/sdb is able to immediately spin down the disk. I tried hd-idle, but that sends a regular sleep command which this disk ignores (http://superuser.com/questions/772088/h ... green-hdds). hd-idle by default behaves the same way, but I changed its code to call hdparm -y instead and that did the trick.

But - there's always a but!

The thing is - the disk never goes to sleep due to system activity. Something is still querying the disk and causes it to spin up within a 5 minute interval. In order to rule out any NAS or network related processes, here is my test setup:
* unmounted all partitions from the disk, turned off autofs
* turned off all monitoring software (smartd, hddtemp, smartmontools, munin). Also I made sure I wasn't using the swap partition on the disk in question

Code: Select all

adrianp@aldebarano:~> sudo service smartd status
* smartd.service - Self Monitoring and Reporting Technology (SMART) Daemon
   Loaded: loaded (/lib/systemd/system/smartd.service; disabled; vendor preset: 
   Active: inactive (dead)
     Docs: man:smartd(8)
           man:smartd.conf(5)
adrianp@aldebarano:~> sudo service smartmontools status
* smartd.service - Self Monitoring and Reporting Technology (SMART) Daemon
   Loaded: loaded (/lib/systemd/system/smartd.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:smartd(8)
           man:smartd.conf(5)
adrianp@aldebarano:~/development/idle3-tools-0.9.1> sudo service munin-node status
* munin-node.service - Munin Node
   Loaded: loaded (/lib/systemd/system/munin-node.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2017-02-06 10:30:00 EET; 1h 13min ago
     Docs: man:munin-node(1)
           http://munin.readthedocs.org/en/stable-2.0/reference/munin-node.html
  Process: 1002 ExecStartPost=/bin/sh -c echo $MAINPID | tee -a /sys/fs/cgroup/cpuset/littlecores/tasks (code=exited, status=0/SUCCESS)
  Process: 961 ExecStart=/usr/sbin/munin-node $DAEMON_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 1001 (code=exited, status=0/SUCCESS)

Feb 06 10:17:36 aldebarano systemd[1]: Starting Munin Node...
Feb 06 10:17:36 aldebarano sh[1002]: 1001
Feb 06 10:17:36 aldebarano systemd[1]: Started Munin Node.
Feb 06 10:30:00 aldebarano systemd[1]: Stopping Munin Node...
Feb 06 10:30:00 aldebarano systemd[1]: Stopped Munin Node.
adrianp@aldebarano:~/development/idle3-tools-0.9.1> sudo service hddtemp status
* hddtemp.service - LSB: disk temperature monitoring daemon
   Loaded: loaded (/etc/init.d/hddtemp; bad; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)

Feb 06 10:17:41 aldebarano systemd[1]: Starting LSB: disk temperature monitoring daemon...
Feb 06 10:17:42 aldebarano systemd[1]: Started LSB: disk temperature monitoring daemon.
Feb 06 11:44:08 aldebarano systemd[1]: Stopping LSB: disk temperature monitoring daemon...
Feb 06 11:44:08 aldebarano systemd[1]: Stopped LSB: disk temperature monitoring daemon.
adrianp@aldebarano:~> swapon
NAME       TYPE       SIZE USED PRIO
/dev/zram0 partition 61.5M   0B    5
/dev/zram1 partition 61.5M   0B    5
/dev/zram2 partition 61.5M   0B    5
/dev/zram3 partition 61.5M   0B    5
/dev/zram4 partition 61.5M   0B    5
/dev/zram5 partition 61.5M   0B    5
/dev/zram6 partition 61.5M   0B    5
/dev/zram7 partition 61.5M   0B    5
I ran a small script that logs to syslog the current state of the disk (via hdparm -C /dev/sdb), I put the drive manually in standby and this is what I notice:

Code: Select all

Feb  6 11:44:24 aldebarano ./checkHDDStatus.sh: Checking drive status every 1s
Feb  6 11:44:24 aldebarano ./checkHDDStatus.sh:  drive state is:  active/idle
Feb  6 11:44:34 aldebarano ./checkHDDStatus.sh: message repeated 10 times: [  drive state is:  active/idle]
Feb  6 11:44:35 aldebarano ./checkHDDStatus.sh:  drive state is:  standby
Feb  6 11:45:01 aldebarano ./checkHDDStatus.sh: message repeated 24 times: [  drive state is:  standby]
Feb  6 11:45:01 aldebarano CRON[9552]: (munin) CMD (if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-cron; fi)
Feb  6 11:45:01 aldebarano CRON[9554]: (root) CMD (if [ -x /etc/munin/plugins/apt_all ]; then /etc/munin/plugins/apt_all update 7200 12 >/dev/null; elif [ -x /etc/munin/plugins/apt ]; then /etc/munin/plugins
/apt update 7200 12 >/dev/null; fi)
Feb  6 11:45:02 aldebarano ./checkHDDStatus.sh:  drive state is:  standby
Feb  6 11:45:03 aldebarano ./checkHDDStatus.sh:  drive state is:  standby
Feb  6 11:45:04 aldebarano ./checkHDDStatus.sh:  drive state is:  standby
Feb  6 11:45:41 aldebarano ./checkHDDStatus.sh: message repeated 35 times: [  drive state is:  standby]
Feb  6 11:45:42 aldebarano ./checkHDDStatus.sh:  drive state is:  standby
Feb  6 11:46:10 aldebarano ./checkHDDStatus.sh: message repeated 26 times: [  drive state is:  standby]
Feb  6 11:46:21 aldebarano ./checkHDDStatus.sh:  drive state is:  active/idle
Feb  6 11:46:21 aldebarano rsyslogd-2007: action 'action 10' suspended, next retry is Mon Feb  6 11:47:51 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Feb  6 11:46:21 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:
/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb1
Feb  6 11:46:21 aldebarano systemd[1]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12
000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb1
Feb  6 11:46:21 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:
/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb2
Feb  6 11:46:21 aldebarano systemd[1]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12
000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb2
Feb  6 11:46:21 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:
/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb1
Feb  6 11:46:21 aldebarano systemd[1]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12
000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb1
Feb  6 11:46:21 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:
/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb4
Feb  6 11:46:21 aldebarano systemd[1]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12
000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb4
Feb  6 11:46:21 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:
/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb2
Feb  6 11:46:21 aldebarano systemd[1]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12
000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb2
Feb  6 11:46:21 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:
/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb2
Feb  6 11:46:21 aldebarano systemd[1]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12
000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb2
Feb  6 11:46:22 aldebarano systemd[1]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12
000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb1
Feb  6 11:46:22 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:
/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb1
Feb  6 11:46:22 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:
/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb4
Feb  6 11:46:22 aldebarano systemd[1]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12
000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb4
Feb  6 11:46:22 aldebarano ./checkHDDStatus.sh:  drive state is:  active/idle
Feb  6 11:46:51 aldebarano ./checkHDDStatus.sh: message repeated 27 times: [  drive state is:  active/idle]
I'm not exactly sure what the cause and the effect are but it looks like the warnings generated by systemd (which I can't make heads or tails of) cause the disk to spin up. I get the same warnings every 5 minutes even when the disk is spun-up already. It seems something (a kernel thread? or something from systemd?) is scanning the disks every 5 minutes. Any ideas what it might be?

Code: Select all

Feb  6 11:56:22 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb4
Feb  6 11:56:22 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb1
Feb  6 11:56:22 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb2
Feb  6 12:01:32 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb1
Feb  6 12:01:32 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb2
Feb  6 12:01:32 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb4
Feb  6 12:01:32 aldebarano systemd[1855]: dev-disk-by\x2dpartlabel-primary.device: Dev dev-disk-by\x2dpartlabel-primary.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb2/2-1/2-1.1/2-1.1:1.0/host0/target0:0:0/0:0:0:0/block/sdb/sdb4

As far as I can see, the UUIDs are unique on my disk:

Code: Select all

adrianp@aldebarano:~> sudo blkid
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="52AA-6867" TYPE="vfat" PARTUUID="3cedfd53-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="e139ce78-9841-40fe-8823-96a304a09859" TYPE="ext4" PARTUUID="3cedfd53-02"
/dev/sda1: LABEL="Seagate-32G" UUID="4283-E975" TYPE="vfat" PARTUUID="b5ea18f3-01"
/dev/sda2: LABEL="Seagate-xfs" UUID="9d2d675d-cb08-45b2-b222-c981a8d00c06" TYPE="xfs" PARTUUID="b5ea18f3-02"
/dev/sdb1: UUID="585826ea-f84f-578c-5a00-8477c557061a" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="0f4e09a0-0b94-4e84-ad81-27bcdac76162"
/dev/sdb2: UUID="fe63ac7f-2a4b-5df6-5a00-8477c557061a" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="cffcdeda-63cd-4a0f-8dea-57ddd5871c4a"
/dev/sdb3: UUID="b0fd946f-37d1-aec0-5a00-8477c557061a" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="6e1322cf-f880-4714-ad2c-751cba6d711a"
/dev/sdb4: UUID="f722c7ae-496c-6306-bb26-17a5f4338677" UUID_SUB="c7eb2f4b-5781-47db-8be4-9e1c78a28d62" LABEL="MyBookWorld:2" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="e523e666-b50e-4e85-9c45-9f37b49909b2"
/dev/md127: UUID="94c83d6a-92f1-4d57-a135-b1c8c4c81bab" TYPE="xfs"
/dev/md126: UUID="32a24eff-c159-46f7-8378-b3f282b8d83b" SEC_TYPE="ext2" TYPE="ext3"
/dev/md125: UUID="d6145d7e-d2fe-477e-9cfb-cd3602fb3726" TYPE="swap"
/dev/md124: UUID="bb58d544-d420-447a-a7c4-ea7d184290c6" SEC_TYPE="ext2" TYPE="ext3"
/dev/zram0: UUID="18d4b3f7-63f1-4c24-a107-9698f0f5d683" TYPE="swap"
/dev/zram1: UUID="6a704e0a-286a-4fec-8673-d09a0f89bfe6" TYPE="swap"
/dev/zram2: UUID="c789d1d6-fa5d-4820-9e04-db1accf468cc" TYPE="swap"
/dev/zram3: UUID="750aad21-4b2e-4a4e-a555-63ae97302c50" TYPE="swap"
/dev/zram4: UUID="03a5924c-7e4d-497a-bf68-cdde722b8f75" TYPE="swap"
/dev/zram5: UUID="ac6ae67e-6f93-4eb5-9f48-3c19a83f1ba4" TYPE="swap"
/dev/zram6: UUID="b0f06df7-1b79-4edf-ab0a-af8ed052a980" TYPE="swap"
/dev/zram7: UUID="2afa93be-6184-4e46-b5e5-ea4c7e1d7908" TYPE="swap"
/dev/mmcblk0: PTUUID="3cedfd53" PTTYPE="dos"
In the meantime I think I will try the following:
1. Try the USB2 port
2. Try kernel 3.10 and wait for HK's 4.9 release
3. If I am to put the disk to sleep sooner than 5 minutes the disk would go to sleep, but would wake up 288 times per day (wearing out the motor/actuators). I need to consider if that's acceptable compared to 24/7 spinning (which will wear out the motor as well).
4. I could connect the disk to a C2 and have the XU4 mount it remotely, but it would defeat the purpose of a XU4-NAS...

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Mon Feb 06, 2017 7:16 pm

Ok, I've investigated a bit. It seems the cryptic error messages are caused by the PARTLABEL being the same for my RAID disk:

Code: Select all

https://bbs.archlinux.org/viewtopic.php?id=196640
I'll try to change it and see if the problem happens again.

Edit: After changing the PARTLABEL I no longer that that cryptic message, but unfortunately the disk still spins up :(

Code: Select all

Feb  6 12:35:50 aldebarano ./checkHDDStatus.sh: Checking drive status every 1s
Feb  6 12:35:50 aldebarano ./checkHDDStatus.sh:  drive state is:  active/idle
Feb  6 12:35:57 aldebarano ./checkHDDStatus.sh: message repeated 7 times: [  drive state is:  active/idle]
Feb  6 12:35:59 aldebarano ./checkHDDStatus.sh:  drive state is:  standby
Feb  6 12:37:33 aldebarano ./checkHDDStatus.sh: message repeated 87 times: [  drive state is:  standby]
Feb  6 12:37:44 aldebarano ./checkHDDStatus.sh:  drive state is:  active/idle
Feb  6 12:37:44 aldebarano rsyslogd-2007: action 'action 10' suspended, next retry is Mon Feb  6 12:39:14 2017 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Feb  6 12:37:55 aldebarano ./checkHDDStatus.sh: message repeated 10 times: [  drive state is:  active/idle]

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Thu Feb 09, 2017 8:07 pm

Ok, I'm close to my wit's end...
Here's what else I tried:
1. The USB2 port behaves the same way
2. Kernel 3.10 behaves the same way. Also, the kernel I tried doesn't support XFS, so it's not really usable anyway.
3. I suspected that because the disk has a mdadm RAID1 array which is incomplete (it's only one disk and it needs two), maybe mdadm causes the disk to wake up periodically. I hooked the disk to my PC (Ubuntu 16.04) and the disk remains in standby when idle. So mdadm is not at fault here.
4. I began to systematically turn off services to see if I can stumble on the one which causes the disk to spin up. Here's what I turned off: cron, autofs, munin-node, apache2, atd, atop, avahi, fail2ban, lvm2-lvmetad, mdadm, mysql, nfs*, nmbd, rpcbind, smbd, transmission-daemon and webmin. I used to turn 2-3 services off and leave the system waiting to see if the disks spun up. When it inevitably did, I turned off some more services. In the end I ended up with only these services running:

Code: Select all

adrianp@aldebarano:~> sudo systemctl | grep running
  init.scope                                                                                                                                                   loaded active running   System and Service Manager
  session-c1.scope                                                                                                                                             loaded active running   Session c1 of user adrianp
  cgmanager.service                                                                                                                                            loaded active running   Cgroup management daemon
  dbus.service                                                                                                                                                 loaded active running   D-Bus System Message Bus
  getty@tty1.service                                                                                                                                           loaded active running   Getty on tty1
  ntp.service                                                                                                                                                  loaded active running   LSB: Start NTP daemon
  rsyslog.service                                                                                                                                              loaded active running   System Logging Service
  serial-getty@ttySAC2.service                                                                                                                                 loaded active running   Serial Getty on ttySAC2
  ssh.service                                                                                                                                                  loaded active running   OpenBSD Secure Shell server
  systemd-journald.service                                                                                                                                     loaded active running   Journal Service
  systemd-logind.service                                                                                                                                       loaded active running   Login Service
  systemd-udevd.service                                                                                                                                        loaded active running   udev Kernel Device Manager
  user@1001.service                                                                                                                                            loaded active running   User Manager for UID 1001
  dbus.socket                                                                                                                                                  loaded active running   D-Bus System Message Bus Socket
  syslog.socket                                                                                                                                                loaded active running   Syslog Socket
  systemd-journald-dev-log.socket                                                                                                                              loaded active running   Journal Socket (/dev/log)
  systemd-journald.socket                                                                                                                                      loaded active running   Journal Socket
  systemd-udevd-control.socket                                                                                                                                 loaded active running   udev Control Socket
  systemd-udevd-kernel.socket                                                                                                                                  loaded active running   udev Kernel Socket
So, this approach paid off. Guess what process was waking up my disk? $profanity Webmin - the last on my list :D. I dug through the internet and it was a known bug a while ago: https://sourceforge.net/p/webadmin/bugs/3999/. I turned off temperature collection and my disk has been quiet since.
Now, I'll have to look into my XFS instability coupled with NFS, but that's a different discussion.

Eurika!

User avatar
rooted
Posts: 6449
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: HD wakeup from powersave

Unread post by rooted » Fri Feb 10, 2017 8:47 am

24/7 is easier on the drive in my experience, as long as it's cool.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 14 times
Been thanked: 16 times
Contact:

Re: HD wakeup from powersave

Unread post by mad_ady » Fri Feb 10, 2017 2:40 pm

Thankfully, that plan is no longer needed. The drive reached 44C when always on, but I think the bearing would eventually break from all the motion

User avatar
rooted
Posts: 6449
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 4 times
Been thanked: 3 times
Contact:

Re: HD wakeup from powersave

Unread post by rooted » Fri Feb 10, 2017 7:28 pm

mad_ady wrote:Thankfully, that plan is no longer needed. The drive reached 44C when always on, but I think the bearing would eventually break from all the motion
I have ran drives continuously for 5 years before running into issues and this was always due to heat.

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Thu Aug 03, 2017 10:41 pm

Hello all,

yesterday I upgraded to the new image Ubuntu16.04.2 with kernel 4.9. What I can state until now is, the the spinning up of my drive is gone. I will have a closer attention on this and report. If it's really true I will mark the thread "solved"

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HD wakeup from powersave

Unread post by odroid » Fri Aug 04, 2017 11:11 am

If your external HDD has any new problem with the latest UAS driver, disable the UAS option just in case.
https://wiki.odroid.com/odroid-xu4/os_i ... s_and_tips
Add "usb-storage.quirks=0xVID:0xPID:u" in your boot.ini file to disable it.
VID/PID is must be edited for your USB-to-SATA bridge controller.

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Mon Aug 07, 2017 2:36 am

Hello odroid,

the problem is old (s.a.), existed from the beginning of using ordoid in autumn 2015, remained in distro 16.04 with kernel 3.xx and as I state today continues with the newest version 16.06.2 kernel 4.9.

I suppose, that it may be a faulty behaviour of my special disk. Manufacturer is Intenso with an ASM1051E SATA-bridge chip. No other disk available to check that.

hfb

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HD wakeup from powersave

Unread post by odroid » Mon Aug 07, 2017 10:03 am

I heard from a few users met the UAS compatibility issue with ASmedia chip.
So it is very worth to try disabling the UAS option.

User avatar
hfb
Posts: 91
Joined: Mon Apr 25, 2016 2:00 am
languages_spoken: english,, deutsch
ODROIDs: XU4 LinuxMate
Has thanked: 0
Been thanked: 0
Contact:

Re: HD wakeup from powersave

Unread post by hfb » Sat Aug 12, 2017 5:45 am

Pardon, but UAS doesn't mean anything to me.
I will need a hint in which way I can follow your advise.

hfb

User avatar
odroid
Site Admin
Posts: 30270
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HD wakeup from powersave

Unread post by odroid » Sat Aug 12, 2017 11:09 am

Refer this link. You have to find the VID:PID of your bridge chip with "lsusb" output.
https://wiki.odroid.com/odroid-xu4/os_i ... s_and_tips

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 2 guests