Update faildisk.sh

This commit is contained in:
kneutron 2022-06-30 11:09:30 -05:00 committed by GitHub
parent d903802ddf
commit 96363142a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,9 @@
#!/bin/bash
# arg = shortname disk e.g. sdc , omit the /dev
# Primarily used in ZFS VM to simulate disk failures in a zpool / test RAIDZx / DRAID recovery scenarios
# NOTE rebooting will fix the failed disks
echo "Failing $1"
echo offline > /sys/block/$1/device/state
echo 1 > /sys/block/$1/device/delete