]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Partitions could be meaningful on single-drive RAID0
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>
Fri, 25 Feb 2011 06:30:51 +0000 (07:30 +0100)
committerNeilBrown <neilb@suse.de>
Sun, 27 Feb 2011 06:13:10 +0000 (17:13 +1100)
If we create a single-drive RAID0 array on partitioned drive,
we do not lose information about disk structure after operation
(partitions are visible on created array)
Warning message:

mdadm: partition table exists on /dev/sdX but will be lost or
       meaningless after creating array"

is not necessary during creation single-drive RAID0 array.
This patch removes the message.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Create.c

index 1cadbcc371dd452980d05770d7b747734d106b92..bbd25e554d04e5941899d713814f8d97d7c4467d 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -381,7 +381,8 @@ int Create(struct supertype *st, char *mddev,
                            st->minor_version >= 1)
                                /* metadata at front */
                                warn |= check_partitions(fd, dname, 0);
-                       else if (level == 1 || level == LEVEL_CONTAINER)
+                       else if (level == 1 || level == LEVEL_CONTAINER
+                                   || (level == 0 && raiddisks == 1))
                                /* partitions could be meaningful */
                                warn |= check_partitions(fd, dname, freesize*2);
                        else