如何模拟拔盘操作

这个对测试和运维drill run还是很有帮助的

 

 

Linux has a nifty way of allowing disk state modification via /sys/ interface. Very useful when debugging LVM mirroring, disk disaster recovery etc.

To put a SATA disk offline/running:

echo offline > /sys/block/sda/device/state
echo running > /sys/block/sda/device/state

To delete a device (for unplugging):

echo 1 > /sys/block/sda/device/delete

To scan for new devices (hotplugging):
echo "0 0 0" >/sys/class/scsi_host/host/scan

 

 

你可能感兴趣的:(模拟)