ngandrass / truenas-spindown-timer

Monitors drive I/O and forces HDD spindown after a given idle period. Resistant to S.M.A.R.T. reads.
MIT License
276 stars 28 forks source link

Not Working on TrueNAS Core 12.0 #6

Closed Frankie3142 closed 3 years ago

Frankie3142 commented 3 years ago

Hi I installed the spin down script on my TrueNAS Core version 12.0, running one SATA HDD (and a boot USB). I set the timeout to 5 mins for testing purposes, and the io check to one minute.

I found regular announcements that the USB stick had been spun down successfully(!), but no mention of the hard drive (which indeed never did spin down). I set the Storage/Disc settings as per your instructions. Nothing seemed to work. Plese note I am not a Linux expert by the way!

Is this not something that works under SATA? Could the problem lie elsewhere?

Thank you for your thoughts.

Frankie.

ngandrass commented 3 years ago

Hey Frankie,

could you please post the full command (including parameters) that you use to start the spindown script?

Please also provide the output of there two commands:

  1. iostat -x
  2. geom disk list

Thanks :)

Frankie3142 commented 3 years ago

Hi Niels! Thank you for your kind response. I have the information you requested (below) but first I should tell you two things I have since learnt (I am a real beginner with TrueNAS!) which I now think will frustrate your script and may be the cause of the HDD not stopping. 1. System disks cannot be spun down! ... I am experimenting and learning about TrueNAS using only 1 HDD disk at the moment (plus a boot USB disk), and so the system is on the HDD, hence it cannot spin down I think? Also, 2. plugins & their jails are also on the HDD - I have read that a disk with a plugin cannot spin down either - this is really bad news for me if it's true.

I was thinking of getting a small inexpensive SDD - say 125Gig - to use as a system disk, JUST so i can spin down the main disks when not in use. Would that be a good idea do you think? Is 125GIG enough space for the system and 3 or 4 plugins?

Anyway here is the info you asked for, just in case it's still helpful.

Parameters. (I set these to work quickly so I could tell if anything was stopping)

TIMEOUT=60 # Default timeout before considering a drive as idle POLL_TIME=20 # Default time to wait during a single iostat call IGNORED_DRIVES="" # Default list of drives that are never spun down MANUAL_MODE=0 # Default manual mode setting QUIET = 0 VERBOSE = 0 DRYRUN = 0

Also the iostat command:

                   extended device statistics

device r/s w/s kr/s kw/s ms/r ms/w ms/o ms/t qlen %b ada0 7 2 5727.3 48.6 13 0 91 10 0 4 da0 0 0 2.4 0.2 1 7 0 2 0 0 cd0 0 0 0.0 0.0 0 0 0 0 0 0 pass0 0 0 0.0 0.0 22 0 15 21 0 0 pass1 0 0 0.0 0.0 0 0 0 0 0 0 pass2 0 0 0.0 0.0 0 0 0 0 0 0 pass3 0 0 0.0 0.0 5 0 0 5 0 0

And lastly the geom command:

Geom name: cd0 Providers:

  1. Name: cd0 Mediasize: 0 (0B) Sectorsize: 2048 Mode: r0w0e0 descr: hp CDDVDW SH-216DB ident: (null) rotationrate: unknown fwsectors: 0 fwheads: 0

Geom name: ada0 Providers:

  1. Name: ada0 Mediasize: 2000398934016 (1.8T) Sectorsize: 512 Stripesize: 4096 Stripeoffset: 0 Mode: r2w2e5 descr: ST2000DM001-1CH164 lunid: 5000c50065f4341e ident: Z1E6YYSE rotationrate: 7200 fwsectors: 63 fwheads: 16

Geom name: da0 Providers:

  1. Name: da0 Mediasize: 30752636928 (29G) Sectorsize: 512 Mode: r1w1e2 descr: SanDisk Ultra USB 3.0 lunname: SanDisk Ultra USB 3.0 4C530001320824121063 lunid: SanDisk Ultra USB 3.0 4C530001320824121063 ident: 4C530001320824121063 rotationrate: unknown fwsectors: 63 fwheads: 255

Thank you Neils!

Regards

Frankie Rockett.


From: Niels Gandraß @.> Sent: 13 April 2021 8:00 AM To: ngandrass/freenas-spindown-timer @.> Cc: Frankie3142 @.>; Author @.> Subject: Re: [ngandrass/freenas-spindown-timer] Not Working on TrueNAS Core 12.0 (#6)

Hey Frankie,

could you please post the full command (including parameters) that you use to start the spindown script?

Please also provide the output of there two commands:

  1. iostat -x
  2. geom disk list

Thanks :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ngandrass/freenas-spindown-timer/issues/6#issuecomment-818492801, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AET2L76V5TAON5M2IT6GPITTIPTYTANCNFSM42W5H2BQ.

Frankie3142 commented 3 years ago

Hi Niels!

[THIS IS A DUPLICATION AS I AM NOT SURE THE FIRST TIME SENT CORRECTLY!]

Thank you for your kind response. I have the information you requested (below) but first I should tell you two things I have since learnt (I am a real beginner with TrueNAS!) which I now think will frustrate your script and may be the cause of the HDD not stopping. 1. System disks cannot be spun down! ... I am experimenting and learning about TrueNAS using only 1 HDD disk at the moment (plus a boot USB disk), and so the system is on the HDD, hence it cannot spin down I think? Also, 2. plugins & their jails are also on the HDD - I have read that a disk with a plugin cannot spin down either - this is really bad news for me if it's true.

I was thinking of getting a small inexpensive SDD - say 125Gig - to use as a system disk, JUST so i can spin down the main disks when not in use. Would that be a good idea do you think? Is 125GIG enough space for the system and 3 or 4 plugins?

Anyway here is the info you asked for, just in case it's still helpful.

Parameters. (I set these to work quickly so I could tell if anything was stopping)

TIMEOUT=60 # Default timeout before considering a drive as idle POLL_TIME=20 # Default time to wait during a single iostat call IGNORED_DRIVES="" # Default list of drives that are never spun down MANUAL_MODE=0 # Default manual mode setting QUIET = 0 VERBOSE = 0 DRYRUN = 0

Also the iostat command:

                   extended device statistics

device r/s w/s kr/s kw/s ms/r ms/w ms/o ms/t qlen %b ada0 7 2 5727.3 48.6 13 0 91 10 0 4 da0 0 0 2.4 0.2 1 7 0 2 0 0 cd0 0 0 0.0 0.0 0 0 0 0 0 0 pass0 0 0 0.0 0.0 22 0 15 21 0 0 pass1 0 0 0.0 0.0 0 0 0 0 0 0 pass2 0 0 0.0 0.0 0 0 0 0 0 0 pass3 0 0 0.0 0.0 5 0 0 5 0 0

And lastly the geom command:

Geom name: cd0 Providers:

  1. Name: cd0 Mediasize: 0 (0B) Sectorsize: 2048 Mode: r0w0e0 descr: hp CDDVDW SH-216DB ident: (null) rotationrate: unknown fwsectors: 0 fwheads: 0

Geom name: ada0 Providers:

  1. Name: ada0 Mediasize: 2000398934016 (1.8T) Sectorsize: 512 Stripesize: 4096 Stripeoffset: 0 Mode: r2w2e5 descr: ST2000DM001-1CH164 lunid: 5000c50065f4341e ident: Z1E6YYSE rotationrate: 7200 fwsectors: 63 fwheads: 16

Geom name: da0 Providers:

  1. Name: da0 Mediasize: 30752636928 (29G) Sectorsize: 512 Mode: r1w1e2 descr: SanDisk Ultra USB 3.0 lunname: SanDisk Ultra USB 3.0 4C530001320824121063 lunid: SanDisk Ultra USB 3.0 4C530001320824121063 ident: 4C530001320824121063 rotationrate: unknown fwsectors: 63 fwheads: 255

Thank you Neils!

Regards

Frankie Rockett.

ngandrass commented 3 years ago

Hey Fankie,

please excuse my very delayed response!

and so the system is on the HDD, hence it cannot spin down I think?

This is indeed a problem. Your system dataset is frequently accessed and therefore wakes the disk from standby. Theoretically the HDD can be spun down but it is spun up by the system nearly immediately, effectively preventing spindown.

Also, 2. plugins & their jails are also on the HDD - I have read that a disk with a plugin cannot spin down either

As with the system dataset, plugins/jails may produce disk I/O that spins up the HDD.

To sum it up: You can unfortunately only spin down disks that neither contain your system dataset nor any running jails/VMs.

I was thinking of getting a small inexpensive SDD - say 125Gig - to use as a system disk, JUST so i can spin down the main disks when not in use. Would that be a good idea do you think? Is 125GIG enough space for the system and 3 or 4 plugins?

This is exactly what I was about to suggest :) Placing the system dataset and all jails/VMs on a separate SSD allows you to spin down your HDDs.

But there is a potential pitfall to keep in mind. All data that is frequently accessed by the plugins/jails wakes the drives it is stored on. The amount of "hot data" you have determines the required size of your SSD. All other "cold data" can be stored on the HDDs.

Kind regards Niels

Frankie3142 commented 3 years ago

Hi Niels! So good to hear from you! Don't worry about the small delay; we have busy lives and that is understood!

Yes we are in agreement about the issue here. In fact I went ahead with buying an SSD and I moved both the system and jails and my 2 plugins there. With a 125Gig SSD I find I still have 100Gig free, so space is no issue. 'Hot and cold' data like you say - one of my plugins is Plex, but I keep all the music and videos separate on a HDD. And the result of all these musical chairs? Utter fsilure! Hahaha! It's true. I documented it in this post FYI https://www.truenas.com/community/threads/something-definitive-on-spinning-down-disks.92599/

I stopped using your script for the time being. With the new layout I went back to just trying to make the GUI do what it promises to do, without resorting to additional scripts at this stage. My "start again approach. While nothing worked, I did receive a message from one person that suggested the check box "Force HDD Spindown" was having the opposite effect and was keeping the wake up cycle running. I started to think the whole Spindown interface is a mess so I tried some 'irrational' settings. I found that by setting it to (from memory) 128 never spin down, un-checking that box, setting spindown time to (whatever-I use 5 mins for testing) and then adding Smart extra params to (again from memory) -d ata -l standby /dev/ada1, I started to see it go into Spindown and "maybe" stay there. Don't quote me, this needs more testing & observation.

Then, at this crucial moment, I have an unrelated issue with a brand new 8Tb HDD. Itvs going back to the retailer for possible exchange. The round trip will be long - 2 weeks maybe - so all experiments are on hold meanwhile!

So 1 step forward, and 1 step backward. Isn't that life too?!

Be well

Frankie.


From: Niels Gandraß @.> Sent: Monday, April 19, 2021 3:16:34 PM To: ngandrass/freenas-spindown-timer @.> Cc: Frankie3142 @.>; Author @.> Subject: Re: [ngandrass/freenas-spindown-timer] Not Working on TrueNAS Core 12.0 (#6)

Hey Fankie,

please excuse my very delayed response!

and so the system is on the HDD, hence it cannot spin down I think?

This is indeed a problem. Your system dataset is frequently accessed and therefore wakes the disk from standby. Theoretically the HDD can be spun down but it is spun up by the system nearly immediately, effectively preventing spindown.

Also, 2. plugins & their jails are also on the HDD - I have read that a disk with a plugin cannot spin down either

As with the system dataset, plugins/jails may produce disk I/O that spins up the HDD.

To sum it up: You can unfortunately only spin down disks that neither contain your system dataset nor any running jails/VMs.

I was thinking of getting a small inexpensive SDD - say 125Gig - to use as a system disk, JUST so i can spin down the main disks when not in use. Would that be a good idea do you think? Is 125GIG enough space for the system and 3 or 4 plugins?

This is exactly what I was about to suggest :) Placing the system dataset and all jails/VMs on a separate SSD allows you to spin down your HDDs.

But there is a potential pitfall to keep in mind. All data that is frequently accessed by the plugins/jails wakes the drives it is stored on. The amount of "hot data" you have determines the required size of your SSD. All other "cold data" can be stored on the HDDs.

Kind regards Niels

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ngandrass/freenas-spindown-timer/issues/6#issuecomment-822501745, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AET2L75TIIQWPMN7ASKP52DTJQ3MFANCNFSM42W5H2BQ.

ngandrass commented 3 years ago

Hehe, I'll then close the issue for now. Feel free to reach out again once your HDD problems are solved and you experience problems with the spindown script :)