[PATCH] mdadm/Create: Be more verbose on the RAID array create failure.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Be more verbose on the RAID array create failure.
Give a hint to check with the kernel messages on an error.

For example (with missing CONFIG_MD_RAID1 in the kernel config) :

$ ./mdadm --create /dev/md1 --raid-devices=2 --level=1 --spare-devices=0 missing /dev/sdb3
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: Check last messages in the kernel log. RUN_ARRAY failed: Invalid argument

$ journalctl -k -e
Aug 13 15:46:05 lifshitz kernel: md: personality for level 1 is not loaded!
Aug 13 15:46:05 lifshitz kernel: md: md1 stopped.

vs (current version):

$ mdadm --create /dev/md1 --raid-devices=2 --level=1 --spare-devices=0 missing /dev/sdb3
...
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: RUN_ARRAY failed: Invalid argument

Signed-off-by: Anatoly Pugachev <matorola@xxxxxxxxx>
---
 Create.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Create.c b/Create.c
index 6f84e5b..99b3701 100644
--- a/Create.c
+++ b/Create.c
@@ -1052,7 +1052,7 @@ int Create(struct supertype *st, char *mddev,
 			/* param is not actually used */
 			mdu_param_t param;
 			if (ioctl(mdfd, RUN_ARRAY, &param)) {
-				pr_err("RUN_ARRAY failed: %s\n",
+				pr_err("Check last messages in the kernel logs. RUN_ARRAY failed: %s\n",
 				       strerror(errno));
 				if (errno == 524 /* ENOTSUP */ &&
 				    info.array.level == 0)
-- 
2.23.0




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux