Having a container created consisting of 2 disks, when one tried to create two volumes of the same RAID level, after attempt of creating the second one, part of the message was missing: #mdadm -C /dev/md/imsm0 -amd -e imsm -n 2 /dev/sda /dev/sdb -R #mdadm -C /dev/md/MyVolume1 -amd -l0 -c128 -n 2 /dev/sda /dev/sdb -R #mdadm -C /dev/md/MyVolume2 -amd -l0 -c128 -n 2 /dev/sda /dev/sdb -R After calling the last command, the output was: mdadm: create aborted Now it's: mdadm: device /dev/sdb not suitable for this style of array mdadm: create aborted Removed a piece of code attempting to exclusively open a file just to check whether it's possible. The reason is that that check was performed when it was already determined that a volume cannot be created. Put a prompt about the device not being suitable instead. Signed-off-by: Lukasz Orlowski <lukasz.orlowski@xxxxxxxxx> --- Create.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Create.c b/Create.c index baadd9f..b5d35e8 100644 --- a/Create.c +++ b/Create.c @@ -349,14 +349,10 @@ int Create(struct supertype *st, char *mddev, } if (!st) { - int dfd = open(dname, O_RDONLY|O_EXCL); - if (dfd >= 0) { - fprintf(stderr, - Name ": device %s not suitable" - " for any style of array\n", - dname); - close(dfd); - } + fprintf(stderr, + Name ": device %s not suitable" + " for this style of array\n", + dname); fail = 1; break; } --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. z siedziba w Gdansku ul. Slowackiego 173 80-298 Gdansk Sad Rejonowy Gdansk Polnoc w Gdansku, VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, numer KRS 101882 NIP 957-07-52-316 Kapital zakladowy 200.000 zl This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ��.n��������+%������w��{.n�����{����w��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f