I want to create a test environment for learning purposes. This is not a production setup of any kind:
Since I don't have 4 disks to use those to build my raid I want to use 4 files as a block device:
I created 4 files using:
dd if=/dev/zero of=disk0.dd bs=512k count=20
dd if=/dev/zero of=disk1.dd bs=512k count=20
dd if=/dev/zero of=disk2.dd bs=512k count=20
dd if=/dev/zero of=disk3.dd bs=512k count=20
I mounted these files as block devices doing:
losetup /dev/loop0 disk0.dd
losetup /dev/loop0 disk1.dd
losetup /dev/loop0 disk2.dd
losetup /dev/loop0 disk3.dd
I created a raid out of these disks using mdadm (The raid is online and looks healthy):
mdadm --create /dev/md0 --level=5 --raid-devices=4 --auto=part /dev/loop
I want to create 1 simple primary partition on /dev/md0 so I can format it using ext3.
When doing this with fdisk /dev/md0 I can create the partition but when I write it I get:
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
I can't create that partition, or at lease, I can't activate that partition,.... there is no /dev/md0p1 anywhere.
stopping the raid and reassembling it doesn't work either,....
It could be a problem related to the fact that i'm using the loopback driver,....
So, how can I get a healthy working partition with this setup?
Any opinions about this?