• Spindown logic in RC2?


    CS01-HS

    I don't know if this is a bug but I wasn't sure where else to post it.

     

    1257155595_ScreenShot2020-12-20at7_02_07AM.thumb.png.a7e062126b66ce63e9e65bd7fc2f2c86.png

     

    I have two spindown problems in RC2:

    I've set default spindown to 15 minutes to help with testing.

     

    (1) The USB disk in Unassigned devices

    Unraid tries to spin it down (good!) but doesn't actually do it. That may be a problem with the drive's USB interface so I've cron'd a user script to spin it down with hdparm -y /dev/sdb (which works.) It looks like unRAID never detects that it's spun down (or a successful return from its own spindown call) because absent drive activity I see this every 15 minutes in the log whatever the drive's status:

    Dec 20 06:45:05 NAS emhttpd: spinning down /dev/sdb
    Dec 20 07:00:06 NAS emhttpd: spinning down /dev/sdb

     

    (2) The Fast pool

    These are 2.5" 7200rpm WD Blacks which also don't spin down. I see nothing in the log indicating unRAID attempts to spin them down except when I trigger it manually with the Web GUI

    Dec 19 21:09:57 NAS emhttpd: spinning down /dev/sdj
    Dec 19 21:09:57 NAS emhttpd: spinning down /dev/sdf
    Dec 19 21:09:57 NAS emhttpd: spinning down /dev/sdi

     

    I've attached diagnostics but this is more a request for information. Should I see spindown calls for Pool drives in syslog?

     

    (I should mention I haven't seen the array disks spin down either but they're set to 2 hours and haven't really had a chance. I'll lower it and keep an eye out.)

    nas-diagnostics-20201220-0734.zip



    User Feedback

    Recommended Comments



    30 minutes ago, JorgeB said:

    Spindown fixes are already coming with rc3, probably best to wait for that and retest.

    Ha! Okay then. I'm still curious about the pool problem (unless the whole setup's changing) because that's been a problem for me since beta-25 (the first one I installed.)

    Edited by CS01-HS
    Link to comment
    Share on other sites

    Hi @CS01-HS my second pool spins down, but didnt seem to when I first when from beta35 to rc1.

     

    But wasn't sure if was due to me setting spin down timer on test pool drive as I had disabled spin downs so my SAS drives would use timers.

     

    Now I have the timer set for the main pool I changed the second pool to use the default and now doesn't make any difference on the setting it spins down.

     

    Try changing the value on the pool and then change it back to see if that kicks it into life, but may have just been coincidence for me.

    • Thanks 1
    Link to comment
    Share on other sites
    Quote

    (1) The USB disk in Unassigned devices

    With this device spun up, take a look at drive state reported by 'hdparm -C'

    It should show as active/idle.

    Next spin it down with 'hdparm -y' and then again take a look at drive state reported by 'hdparm -C'

    Does it say "standby"?

     

    Quote

    (2) The Fast pool

    This not spinning down is puzzling... investigating.

    Link to comment
    Share on other sites
    5 hours ago, limetech said:

    With this device spun up, take a look at drive state reported by 'hdparm -C'

    It should show as active/idle.

    Next spin it down with 'hdparm -y' and then again take a look at drive state reported by 'hdparm -C'

    Does it say "standby"?

     

    hdparm -C doesn't seem to work with it but smartctl and hdparm -y do.

    root@NAS:~# hdparm -C /dev/sdb
    /dev/sdb:
    SG_IO: bad/missing sense data, sb[]:  f0 00 01 00 50 40 ff 0a 80 00 b4 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    drive state is:  unknown
    
    root@NAS:~# smartctl --nocheck standby -i /dev/sdb
    smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.10.1-Unraid] (local build)
    Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
    === START OF INFORMATION SECTION ===
    Model Family:     Western Digital Elements / My Passport (USB, AF)
    Device Model:     WDC WD40NMZW-11GX6S1
    Serial Number:    WD-WX11D9660PZ7
    LU WWN Device Id: 5 0014ee 65c75afb2
    Firmware Version: 01.01A01
    User Capacity:    4,000,753,472,000 bytes [4.00 TB]
    Sector Sizes:     512 bytes logical, 4096 bytes physical
    Rotation Rate:    5400 rpm
    Form Factor:      2.5 inches
    Device is:        In smartctl database [for details use: -P show]
    ATA Version is:   ACS-3 (minor revision not indicated)
    SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
    Local Time is:    Sun Dec 20 12:41:35 2020 EST
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    Power mode is:    ACTIVE or IDLE
    
    root@NAS:~# hdparm -y /dev/sdb
    /dev/sdb:
    issuing standby command
    SG_IO: bad/missing sense data, sb[]:  f0 00 01 00 50 40 00 0a 80 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    
    root@NAS:~# hdparm -C /dev/sdb
    /dev/sdb:
    SG_IO: bad/missing sense data, sb[]:  f0 00 01 00 50 40 00 0a 80 00 b4 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    drive state is:  unknown
    
    root@NAS:~# smartctl --nocheck standby -i /dev/sdb
    smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.10.1-Unraid] (local build)
    Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
    Device is in STANDBY mode, exit(2)
    
    root@NAS:~#

     

    5 hours ago, limetech said:

    This not spinning down is puzzling... investigating.

    Thanks. Like I said it's not a result of the recent changes - it's been a problem since I added the pool in beta25.

    Edited by CS01-HS
    Link to comment
    Share on other sites

    sdb is USB attached, looks like hdparm is handling that. I have a sony 1tb usb that hdparm reports as standby when its spinning but smartctl states doesn't support ata commands for Power condition.

     

    Do you get the same results with sdj/f/i

    Link to comment
    Share on other sites
    28 minutes ago, SimonF said:

    Do you get the same results with sdj/f/i

    No they all work as expected:

    root@NAS:~# hdparm -C /dev/sdf
    /dev/sdf:
     drive state is:  active/idle
    root@NAS:~# hdparm -C /dev/sdi
    /dev/sdi:
     drive state is:  active/idle
    root@NAS:~# hdparm -C /dev/sdj
    /dev/sdj:
     drive state is:  active/idle
    
    root@NAS:~# hdparm -y /dev/sdf
    /dev/sdf:
     issuing standby command
    root@NAS:~# hdparm -y /dev/sdi
    /dev/sdi:
     issuing standby command
    root@NAS:~# hdparm -y /dev/sdj
    /dev/sdj:
     issuing standby command
    
    root@NAS:~# hdparm -C /dev/sdf
    /dev/sdf:
     drive state is:  standby
    root@NAS:~# hdparm -C /dev/sdi
    /dev/sdi:
     drive state is:  standby
    root@NAS:~# hdparm -C /dev/sdj
    /dev/sdj:
     drive state is:  standby
    root@NAS:~# 

     

    Link to comment
    Share on other sites
    35 minutes ago, SimonF said:

    Did you try changing the spin down timer option for the fast pool

    Yes, I followed your advice.

     

    With default timer set to 15:

    I changed the Fast Pool disks from default to 15 and waited ~1hr for spindown: no spindown

    I then changed them back to default and waited ~1hr for spindown: no spindown

    Link to comment
    Share on other sites
    46 minutes ago, CS01-HS said:

    Yes, I followed your advice.

    Ah, was worth a shot. I only have a single drive in my second pool, so not sure if they makes a difference, it shouldnt.

     

    Sorry don't know what else to suggest. Maybe Limetech will find something.

     

    I dont use autofan, does that query the disks for temps? 

     

    • Thanks 1
    Link to comment
    Share on other sites
    13 minutes ago, SimonF said:

    I dont use autofan, does that query the disks for temps? 

    Yes and good intuition.

     

    The standard version uses smartctl -A

    but I customized mine to include --nocheck standby

     

    That may still cause problems but it queries the array disks too which until recently spun down fine.

    Link to comment
    Share on other sites

    Does sdspin script exist in usr/local/sbin

     

    Its called by the process to spin down and up

     

    You can do sdspin sdf up and sdspin sdf down

    Link to comment
    Share on other sites
    3 minutes ago, SimonF said:

    You can do sdspin sdf up and sdspin sdf down

    Huh, interesting. Yes it does and it seems to work when I run it manually (although state change is not reflected in the Web GUI.)

    root@NAS:~# /usr/local/sbin/sdspin sdf up
    
    root@NAS:~# hdparm -C /dev/sdf
    
    /dev/sdf:
    drive state is:  active/idle
    
    root@NAS:~# /usr/local/sbin/sdspin sdf down
    
    root@NAS:~# hdparm -C /dev/sdf
    
    /dev/sdf:
    drive state is:  standby
    
    root@NAS:~#

     

    Link to comment
    Share on other sites

     

    38 minutes ago, CS01-HS said:

    although state change is not reflected in the Web GUI.

    That is done by the emhttp process which calls this script.

     

    Sounds like something else is spinning the drives up.

     

    I have a wrapper around the commands whilst in rc and was working on SAS spinup/down and fixes to smartctl.

     

    Below is part of my go file and attached are the two wrappers.

     

    hdparm and smartctl are moved  and wrappers replace them and call the real command. You need to check it points to the correct real command in the wrapper.

     

    it should only be the real command in the smartctl wrapper you need to correct as it was using smartctl.r5131 on my system if you want to use them.

     

    mv /usr/sbin/smartctl /usr/sbin/smartctl.old
    cp /boot/extras/smartctl.wrapper /usr/sbin/smartctl
    chmod +x /usr/sbin/smartctl

    cp /usr/sbin/hdparm /usr/local/sbin/hdparm.real
    chmod +x /usr/local/sbin/hdparm.real
    cp /boot/extras/hdparm.wrapper /usr/sbin/hdparm
    chmod +x /usr/sbin/hdparm

     

    You will get output in syslog so you can see what is using the commands and args.

     

    Dec 20 13:47:39 Tower smartctl wrapper[17892]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdb, args "-A /dev/sdb"

    Dec 20 13:47:59 Tower hdparm wrapper[18010]: caller is bash, grandpa is ttyd, device /dev/sdb, args "-C /dev/sdb"

     

     

    Wrapper and Smartctl.zip

    Edited by SimonF
    • Thanks 1
    Link to comment
    Share on other sites

    Huh it looks like the Web GUI is calling smartctl without -n standby.

    Oversight in RC2 or am I misreading?

    Dec 20 17:53:31 NAS smartctl wrapper[26619]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdg, args "-A /dev/sdg"
    Dec 20 17:53:31 NAS smartctl wrapper[26642]: caller is smartctl_type, grandpa is emhttpd, device /dev/sde, args "-A /dev/sde"
    Dec 20 17:53:31 NAS smartctl wrapper[26649]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdh, args "-A /dev/sdh"
    Dec 20 17:53:31 NAS smartctl wrapper[26645]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdj, args "-A /dev/sdj"
    Dec 20 17:53:31 NAS smartctl wrapper[26646]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdf, args "-A /dev/sdf"
    Dec 20 17:53:31 NAS smartctl wrapper[26655]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdi, args "-A /dev/sdi"

     

    Link to comment
    Share on other sites

    it does call that to get temps for disks that are spun up. In your disk settings what is the value of your poll attributes, mine is 1800 and spin down delay of 15mins.

     

    image.thumb.png.9005e2a2aef88732c59f0fb348694190.png

    • Like 1
    Link to comment
    Share on other sites

    Right, I missed the hdparm check right before it. Full context:

    Dec 20 17:53:31 NAS hdparm wrapper[26550]: caller is sdspin, grandpa is sdspin, device /dev/sdj, args "-C /dev/sdj"
    Dec 20 17:53:31 NAS hdparm wrapper[26560]: caller is sdspin, grandpa is sdspin, device /dev/sdh, args "-C /dev/sdh"
    Dec 20 17:53:31 NAS hdparm wrapper[26570]: caller is sdspin, grandpa is sdspin, device /dev/sdg, args "-C /dev/sdg"
    Dec 20 17:53:31 NAS hdparm wrapper[26580]: caller is sdspin, grandpa is sdspin, device /dev/sde, args "-C /dev/sde"
    Dec 20 17:53:31 NAS hdparm wrapper[26590]: caller is sdspin, grandpa is sdspin, device /dev/sdf, args "-C /dev/sdf"
    Dec 20 17:53:31 NAS hdparm wrapper[26601]: caller is sdspin, grandpa is sdspin, device /dev/sdi, args "-C /dev/sdi"
    
    Dec 20 17:53:31 NAS smartctl wrapper[26619]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdg, args "-A /dev/sdg"
    Dec 20 17:53:31 NAS smartctl wrapper[26642]: caller is smartctl_type, grandpa is emhttpd, device /dev/sde, args "-A /dev/sde"
    Dec 20 17:53:31 NAS smartctl wrapper[26649]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdh, args "-A /dev/sdh"
    Dec 20 17:53:31 NAS smartctl wrapper[26645]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdj, args "-A /dev/sdj"
    Dec 20 17:53:31 NAS smartctl wrapper[26646]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdf, args "-A /dev/sdf"
    Dec 20 17:53:31 NAS smartctl wrapper[26655]: caller is smartctl_type, grandpa is emhttpd, device /dev/sdi, args "-A /dev/sdi"

     

    EDIT: And now that I'm looking at it I see the smartctl calls in the original autofan are wrapped in hdparm -C calls, so my -n standby isn't necessary.

     

    Edited by CS01-HS
    Link to comment
    Share on other sites

    Hi @CS01-HS

     

    Not sure if autofan would be using sdspin, it may have been updated to use the new process. The smartctl_type are the calls to get temps, normally you see read SMART in log before it.

     

    Do you have the file activity plugin to see if any reads/writes on files which may stop spin down from happening.

     

    To check if it was an issue with multiple drives in a pool, I added a second disk into my testpool and on my system  spins them down fine.

     

    image.thumb.png.bb82034269e0851f59646842ba7d0e46.png

    • Thanks 1
    Link to comment
    Share on other sites
    35 minutes ago, SimonF said:

    Not sure if autofan would be using sdspin

    Given the coincident timestamps I assume they were calls from the Web GUI. No calls to sdspin in the autofan script.

     

    38 minutes ago, SimonF said:

    Do you have the file activity plugin to see if any reads/writes on files which may stop spin down from happening.

    I'll test that but I suspect not. I wrote a script that uses /proc/diskstats to track disk activity and spin them down after X minutes. It works for the pool drives which don't spin up again until they're active.

     

    One thing I noticed in my investigation - calling smartctl -A without -n standby on these WD Blacks doesn't wake them from standby. When I spin them down with hdparm -y (bypassing unRAID's management) the Web GUI continues to report their declining temperatures.

     

    46 minutes ago, SimonF said:

    To check if it was an issue with multiple drives in a pool, I added a second disk into my testpool and on my system  spins them down fine.

    Thanks I appreciate the help.

    Link to comment
    Share on other sites
    20 minutes ago, CS01-HS said:

    WD Blacks doesn't wake them

    All I can think of is that these values are not stored on the media, or cached. 

     

    I know disks store values in sectors on the disk hence why they spin up for some values. Maybe as I suspect they where for laptops maybe they have been built with power saving in mind.

    Link to comment
    Share on other sites

    No activity on array disks between spindown and unraid spinning them up. Alternate pool support was just added to the plugin but it introduced a bug that prevents starting the service. Limetech said there'd be spindown fixes in RC3 so maybe waiting's the best strategy.

    • Like 1
    Link to comment
    Share on other sites

    I have an issue, I think is related to spin down problems.
     

    I am seeing reads on all disks, when cache is being written, even though there is no real activity on the drives.

     

    I believe its keeping the drives spun up.
    if I manually spin down drives, unraid still says its reading from the spun down drives.

     

    image.thumb.png.6456451559c9b236fb2bdeefabe15409.png

     

    image.thumb.png.0d325a0e077e2b167000e328ac223ec3.png

     

    image.thumb.png.381f2e1812160b563c5c873435cc9215.png

     

    Thank goodness for Boxing Day Sales today....  time for more space, yes i know.

    Edited by TRusselo
    Link to comment
    Share on other sites
    2 hours ago, TRusselo said:

    I am seeing reads on all disks

    I am not seeing this on my system, may be worth  adding diagnostics so limetech have it.

    Seems to be a few  bargins out there.

    Link to comment
    Share on other sites



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.