Created
June 7, 2019 20:12
-
-
Save tosih/7151a4105e90b87c6ea8f736f539d660 to your computer and use it in GitHub Desktop.
Steps used to hot swap a failing disk in my OSX ZFS pool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Export pool to reimport with the less safe (because they vary) BSD disk names in /dev, | |
zpool export Data | |
zpool import -d /dev Data | |
# Take down faulty disk | |
zpool offline Data /dev/<faulty_disk> | |
# Replace physical disk | |
zpool online Data /dev/<faulty_disk> | |
# Start resilver process to repair pool (should be the same name) | |
zpool replace Data /dev/<new_disk> | |
# Export pool to reimport with the names in /var/run/disk/by-id | |
zpool export Data | |
zpool import -d /private/var/run/disk/by-id Data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment