]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Create: warn when creating a raid1 using default metadata.
authorNeilBrown <neilb@suse.de>
Thu, 19 Nov 2009 04:54:49 +0000 (15:54 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 19 Nov 2009 04:54:49 +0000 (15:54 +1100)
As a some/most bootloaders don't understand md metadata, it might
be difficult to boot off an array with the default 1.0 metadata.
So if this is used for a RAID1, ask for confirmation.

Signed-Off-By: NeilBrown <neilb@suse.de>
Create.c

index 60e53f3642b0b4d54f1c740a8d8a27e5d924b6ae..5b01b63d61cea1f7a9d67bf0c27a65c2d5737d9c 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -375,6 +375,17 @@ int Create(struct supertype *st, char *mddev,
                        warn |= check_ext2(fd, dname);
                        warn |= check_reiser(fd, dname);
                        warn |= check_raid(fd, dname);
+                       if (st && strcmp(st->ss->name, "1.x") == 0 &&
+                           st->minor_version >= 1 &&
+                           did_default &&
+                           level == 1) {
+                               warn = 1;
+                               fprintf(stderr, Name ": Note: this array has metadata at the start and\n"
+                                       "    may not be suitable as a boot device.  If you plan to\n"
+                                       "    store '/' or '/boot' on this device please ensure that\n"
+                                       "    your boot-loader understands md/v1.x metadata, or use\n"
+                                       "    --metadata=1.0\n");
+                       }
                        close(fd);
                }
        }