Is it possible to create a RAID array on files for testing purposes?
Suppose I want to create a level-1 RAID and I don't have for example 10 block devices to do that but instead I want to simulate that using files instead of block devices.
What I've done so far is this:
fallocate -l 1M disk1
fallocate -l 1M disk2
mkfs.ext4 disk1
mkfs.ext4 disk2
sudo mdadm --create --assume-clean --level=1 --raid-devices=2 /dev/md0 ./disk1 ./disk2
But after that I get the error :
mdadm: ./disk1 is not a block device.
Any idea?