From 24725fd747420c7d2e539e4ca4acb221b92ead49 Mon Sep 17 00:00:00 2001 From: kneutron <50146127+kneutron@users.noreply.github.com> Date: Thu, 30 Jun 2022 11:06:41 -0500 Subject: [PATCH] Sim disk failure in VM --- VIRTBOX/faildisk.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 VIRTBOX/faildisk.sh diff --git a/VIRTBOX/faildisk.sh b/VIRTBOX/faildisk.sh new file mode 100644 index 0000000..dfc258e --- /dev/null +++ b/VIRTBOX/faildisk.sh @@ -0,0 +1,9 @@ +#!/bin/bash +#d2f=$(ls -l /sys/dev/block |awk '/'$1'/ {print $9}') + +echo "Failing $1" +echo offline > /sys/block/$1/device/state +echo 1 > /sys/block/$1/device/delete + +sleep 2 +dmesg|grep $1