A better solution would be to set up a virtual machine and test in a VM, but this can be done without using a VM.
What you need to do is create a loopback device.
- Create a 100MB file:
dd if=/dev/zero of=loopback_file1 bs=1M count=100
- Assign that file as a loopback device:
losetup /dev/loop0 loopback_file1
.
From then on the block device /dev/loop0
will appear like a drive, and the contents will go to the loopback_file1
file. You can then test your mdadm commands against that device.
Links: