Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Drive Scripts

The scripts within this project are for useful operations across all supported operating systems for any drive procedures such as Burn-In/Erase processes.

Table of Contents

Warnings

⚠️ ⚠️ ⚠️
⚠️ Executing Burn-In/Erase scripts will destroy data! ⚠️
⚠️ ⚠️ ⚠️

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Setup

In order to use the scripts within this package, you will need to clone, or download, the Utility-Scripts repository into the same top-level directory path.

/path/to/Utility-Scripts
/path/to/Drive-Scripts

Scripts

Burn-In

burnin_drives.sh

A script to begin a drive Burn-In for a collection of drives.

The following steps will be performed:

  1. Start a new TMUX session named “drive_burnin[_{session_suffix}]” (The brackets ([]) indicate the format used if a suffix is provided)
  2. Pull drive list from passed in values or grab all available SMART drives
  3. Prompt for the user to confirm, if not ask about each drive
  4. Setup a TMUX grid layout for all drives being burned in
  5. Attach to the new TMUX session
  6. Start the Burn-In process
  7. End the TMUX session, if chosen, on detach

Usage

[bash] ./burnin_drives.sh [auto_skip] [drives_override] [zero_drives] 
[session_suffix] [end_on_detach]

Options

Option Flag Description
N/A N/A

Parameters

Parameter Description
Automated Skip Continue without prompting
Drives Override Array of drive IDs to burn-in
Zero Drives Zero the drives after testing has completed
Session Suffix Suffix to add to the session name
End On Detach End process when the TMUX session is detached

Examples

  • ./burnin_drives.sh "/dev/da0 /dev/da1 /dev/da2"
  • ./burnin_drives.sh "/dev/da0 /dev/da1 /dev/da2" true
  • ./burnin_drives.sh "/dev/da0 /dev/da1 /dev/da2" false "session2"
  • ./burnin_drives.sh "/dev/da0 /dev/da1 /dev/da2" false "session2" true
  • ./burnin_drives.sh "auto_skip""/dev/da0 /dev/da1 /dev/da2" false "session2" true

Drives Tested

Status Component
WD Red Plus (8TB)
WD Red Plus (6TB)
WD Red (6TB)
WD Red Plus (3TB)
Kingston 240GB A400

burnin_drive.sh

A script to begin a drive Burn-In for a single drive.

The following steps will be performed:

  1. Pull drive info and display it
  2. Run a SMART conveyance test
  3. Run a SMART short test
  4. Run a SMART long test
  5. Read SMART results and display them
  6. Run a basic imaging write test
  7. Read SMART results and display them
  8. Run a basic imaging read test
  9. Read SMART results and display them
  10. HDD/SSD Specific Steps
    1. HDD
      1. Run a basic imaging read-write test
      2. Read SMART results and display them
      3. Run a destructive BadBlocks test
      4. Read SMART results and display them
    2. SSD
      1. Nothing at this time
  11. Run a SMART conveyance test
  12. Run a SMART short test
  13. Run a SMART long test
  14. Read SMART results and display them
  15. If desired, zero-out the drive, otherwise write random data across it
  16. Pull drive info and display it

Usage

[bash] ./burnin_drive.sh [auto_skip] <drive> [zero_drive]

Options

Option Flag Description
N/A N/A

Parameters

Parameter Description
Automated Skip Continue without prompting
Drive Drive to test
Zero Drive Zero the drive after testing has completed

Examples

  • ./burnin_drive.sh "/dev/da1"
  • ./burnin_drive.sh "/dev/da1" true
  • ./burnin_drive.sh "auto_skip" "/dev/da1" true

Drives Tested

Status Component
WD Red Plus (8TB)
WD Red Plus (6TB)
WD Red (6TB)
WD Red Plus (3TB)
Kingston 240GB A400

Erase

erase_drives.sh

A script to begin a drive erase for a collection of drives.

The following steps will be performed:

  1. Start a new TMUX session named “drive_erase[_{session_suffix}]” (The brackets ([]) indicate the format used if a suffix is provided)
  2. Pull drive list from passed in values or grab all available SMART drives
  3. Prompt for the user to confirm, if not ask about each drive
  4. Setup a TMUX grid layout for all drives being erased
  5. Attach to the new TMUX session
  6. Start the Erase process
  7. End the TMUX session, if chosen, on detach

Usage

[bash] ./erase_drives.sh [auto_skip] [drives_override] [session_suffix] 
[end_on_detach]

Options

Option Flag Description
N/A N/A

Parameters

Parameter Description
Automated Skip Continue without prompting
Drives Override Array of drive IDs to erase
Session Suffix Suffix to add to the session name
End On Detach End process when the TMUX session is detached

Examples

  • ./erase_drives.sh "/dev/da0 /dev/da1 /dev/da2"
  • ./erase_drives.sh "/dev/da0 /dev/da1 /dev/da2" "session2"
  • ./erase_drives.sh "/dev/da0 /dev/da1 /dev/da2" "session2" true
  • ./erase_drives.sh "auto_skip" "/dev/da0 /dev/da1 /dev/da2" "session2" true

Drives Tested

Status Component
WD Red Plus (8TB)
WD Red Plus (6TB)
WD Red (6TB)
WD Red Plus (3TB)
Kingston 240GB A400

erase_drive.sh

A script to begin a drive erase for a single drive.

The following steps will be performed:

  1. Pull drive info and display it
  2. HDD/SSD Specific Steps
    1. HDD
      1. Run a pass with a RANDOM pattern
      2. Run a pass with a RANDOM pattern
      3. Run a pass with a ZERO pattern
    2. SSD
      1. Run a pass with a RANDOM pattern
      2. Run a pass with a RANDOM pattern
      3. Run a pass with a ZERO pattern
  3. Pull drive info and display it

Usage

[bash] ./erase_drive.sh [auto_skip] <drive>

Options

Option Flag Description
N/A N/A

Parameters

Parameter Description
Automated Skip Continue without prompting
Drive Drive to erase

Examples

  • ./erase_drive.sh "/dev/da3"
  • ./erase_drive.sh "auto_skip" "/dev/da3"

Drives Tested

Status Component
WD Red Plus (8TB)
WD Red Plus (6TB)
WD Red (6TB)
WD Red Plus (3TB)
Kingston 240GB A400

Deployment

This section provides additional notes about how to deploy this on a live system.

Dependencies

Notes

This project does not contain any additional notes at this time.

Test Environments

Operating System Compatibility

Status System
MacOS 11.2.x
MacOS 11.1.x
MacOS 11.0.x
TrueNAS 12.0-U2.1
TrueNAS 12.0-U2
TrueNAS 12.0-U1.1
TrueNAS 12.0-U1
TrueNAS 12.0-RELEASE
ℹ️ TrueNAS < 12.0-RELEASE
ℹ️ FreeNAS < TrueNAS 12.0-RELEASE

Hardware Compatibility

Status Component
MacBook Pro (15-inch, 2018)

Contributing

Please read CODE_OF_CONDUCT for details on our Code of Conduct and CONTRIBUTING for details on the process for submitting pull requests.

Support

Please read SUPPORT for details on how to request support from the team. For any security concerns, please read SECURITY for our related process.

Versioning

We use Semantic Versioning for versioning. For available releases, please see the available tags or look through our Release Notes. For extensive documentation of changes between releases, please see the Changelog.

Authors

  • Jack Thorp - Initial work - jhthorp

See also the list of contributors who participated in this project.

Copyright

Copyright © 2020 - 2021, Jack Thorp and associated contributors.

License

This project is licensed under the GNU General Public License - see the LICENSE for details.

Acknowledgments

  • N/A

About

A collection of Hard Drive scripts.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages