NeilBrown: Create: warn when creating a raid1 using default metadata.

Martin F. Krafft madduck at alioth.debian.org
Wed Jan 27 02:01:22 UTC 2010


Module: mdadm
Branch: build
Commit: a0962fe959ce7cfc36dba046cd2ba961d115c522
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=a0962fe959ce7cfc36dba046cd2ba961d115c522

Author: NeilBrown <neilb at suse.de>
Date:   Thu Nov 19 15:54:49 2009 +1100

Create: warn when creating a raid1 using default metadata.

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 at suse.de>

---

 Create.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/Create.c b/Create.c
index 60e53f3..5b01b63 100644
--- 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);
 		}
 	}




More information about the pkg-mdadm-commits mailing list