Github repository for FreeNAS scripts, including disk burnin and rsync support

Github repository for FreeNAS scripts, including disk burnin and rsync support

Github repository for FreeNAS scripts, including disk burnin and rsync support

I am maintaining three repositories on GitHub for these purposes:
  • Administration and reporting
  • Disk burn-in
  • Rsync
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
  • badblocks -b 4096 -wsv -e 1 -o [bb data file] /dev/[device ID]
  • 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! :)

Repository: github.com/Spearfoot/scripts-for-using-rsync

Contains a pair of shell scripts for using rsync:
  • rsync-invoke.sh: Runs rsync directly, with options known to work well on FreeNAS.
  • rsync-module.sh: Runs rsync with the target being an rsync module on the remote server, using the same options as above.
Full description and examples are available on the GitHub repository.

Here are typical rsync module settings I use on my FreeNAS 11.2-U8 systems:
boomer-rsync-module-tank.jpg
Author
Spearfoot
Views
325,971
First release
Last update
Rating
5.00 star(s) 13 ratings

More resources from Spearfoot

Latest updates

  1. Improved the configuration backup script: save_config.sh

    This updated version creates a tarball containing a validated copy of the TrueNAS/FreeNAS...
  2. ZPool report script updated for use with TrueNAS 12.0

    I've pushed an update to the zpool_report.sh script on GitHub that fixes the date parsing...
  3. Changes to disk burn-in script

    Improved the GitHub 'Read Me' file Dry runs are no longer the default setting Changed badblocks...
  4. Added rsync script repository

    I've added a new repository with two rsync-related scripts.
  5. Announcing support for SAS drives in the SMART report script

    We now have support for SAS drives in the smart_report.sh script, along with other enhancements...

Latest reviews

I burnin all my disks as a matter of course using this script, and I can confirm that it seems to work on SCALE 23.10.2
Thankyl you for your great and awesome work!
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!
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.
Top