Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.
Github repository for FreeNAS scripts, including disk burnin

Github repository for FreeNAS scripts, including disk burnin

I've created two repositories on GitHub: one containing FreeNAS-related scripts and another for a disk burnin script. These are all POSIX-compliant shell scripts that I've 'linted' at www.shellcheck.net, so they're free of syntax errors and all seem to work well. I use slightly modified version on my systems.

I've recently begun adding Perl code to the repository as well.

Repository: github.com/Spearfoot/FreeNAS-scripts

Contains my versions of @Bidule0hm's code from his "Scripts to report SMART, ZPool and UPS status, HDD/CPU T°, HDD identification and backup the config" thread. My motivation in setting this up was to have a readily accessible place where users can find them -- @Bidule0hm 's original thread is so long that it's unwieldy trying to navigate it looking for the latest suggested modifications. I've made a few bug fixes and enhancements (e.g., supporting 18-character serial numbers vs. only 15 in the original version of smart_report.sh). Here is a list of what's available:
  • get_hdd_temp.sh : List current CPU and hard drive temperatures
  • get-system-temps.pl: Perl script with the same functionality as get_hdd_temp.sh above
  • save_config.sh : Save copy of configuration file
  • save_config_enc.sh: Save copy of configuration file and optionally email it to yourself as an encrypted tarball
  • set_hdd_erc.sh : Configure TLER/ERC setting on drives
  • smart_report.sh : Email a SMART report
  • ups_report.sh : Email a UPS report
  • zpool_report.sh : Email a pool report
Repository: github.com/Spearfoot/disk-burnin-and-testing

Contains disk-burnin.sh, a shell script for testing/burning-in drives. This was inspired by @qwertymodo's "How To: Hard Drive Burn-In Testing" thread and by my being lazy. It's not specific to FreeNAS: I typically run it on an old Core 2 Duo system equipped with 8GB of RAM and a Dell H200 HBA running Ubuntu Sever 16.04.02 LTS. It queries the disk for the short and long SMART test durations, calculates the appropriate sleep periods, and then runs this series of operations:
  • SMART short test, sleeping until complete
  • SMART long test, sleeping until complete
  • badblocks -b 4096 -wsv -o [bb data file] /dev/[device ID]
  • SMART short test, sleeping until complete
  • SMART long test, sleeping until complete
I will endeavor to keep these repositories up-to-date with bug fixes and suggested changes as time goes by... and everyone is welcome to submit pull requests, too! :)
Author
Spearfoot
Views
503
First release
Last update
Rating
5.00 star(s) 11 ratings

More resources from Spearfoot

Latest updates

  1. Modified zpool_status.sh script to support FreeNAS 11.1

    zpool output changed from FreeNAS version 11.0 to 11.1, breaking our parsing of the scrubErrors...
  2. Added Perl script to report CPU and disk temperatures

    Added a Perl script (get-system-temps.pl) to my FreeNAS-scripts repository on GitHub. The script...
  3. New script to save your configuration file and email it to you as an encrypted tarball

    The title pretty much says it all. I've posted a new script on GitHub...
  4. Added IPMI support to get_hdd_temp.sh script

    I've added IPMI support to the get_hdd_temp.sh script. When enabled, the script uses IPMI to...
  5. Disk burnin script modified to correctly parse extended test duration for large drives

    Summary: Forum member @Mugiwara discovered a bug in the disk-burnin.sh script, which was unable...

Latest reviews

Great info. got files on my server and configured them and had the info within minutes. Neat info!
Nicely done, I appreciate the value of having important\useful scripts like this in 1 place, thank you for taking the time to put these together.
Thanks for sharing these usful scripts.
Useful scripts, especially the disk-burnin!
Thx
I tried these scripts out over the weekend and they all worked beautifully. Thank you for your hard work putting these together and sharing them with the community.
The scripts provide a nice overview on the status of your zpool and drives without extra requirements. I think they should have been part of the standard feature set of freenas.
Useful and convenient, also all in one place for reference.
most excellent.
Nicely done! Way to help out!
Top