mirror of
https://github.com/kneutron/ansitest.git
synced 2025-01-16 04:42:55 +08:00
13 lines
332 B
Bash
13 lines
332 B
Bash
#!/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
|
|
|
|
sleep 2
|
|
dmesg|grep $1
|