Received: from list by lists.gnu.org with archive (Exim 4.71) id 1c7Szz-0005ic-VM for mharc-grub-devel@gnu.org; Thu, 17 Nov 2016 15:09:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7Szy-0005iU-6t for grub-devel@gnu.org; Thu, 17 Nov 2016 15:09:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7Szx-00026Y-BW for grub-devel@gnu.org; Thu, 17 Nov 2016 15:09:30 -0500 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:35205) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c7Szx-00024H-4q for grub-devel@gnu.org; Thu, 17 Nov 2016 15:09:29 -0500 Received: by mail-pg0-x244.google.com with SMTP id p66so18388911pga.2 for ; Thu, 17 Nov 2016 12:09:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leblancnet-us.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=hxpiq/oPG0DrjrL9Iy8eqnGAwCpvv0aB6eGBgw7h0nA=; b=SA5tJ2Kyid1PLDxU31oUNOC2bs9zEO5uNhYk2HkYejqfSUFx7I00CCg/Cdw2Bf8t31 MtAx3s0tR5YHIUpsROLAOhGq9b5EIye/rpCn1M0hnbLmgn6tIHLEGQ6yiaYMk6Oc9evs wWBd/RSN9++q2qSi7kbCgB1tAQczjfbEvdCwgTFabfhS+Of24F1cLvK9PGw0Id1HEK8e Gmfy5tmVX/JgQhKomkcBSquW0UHpXp/XzDx21de6XQ4QmYfQQ/mbgtnXePdZdh3PVCQW 7iIfWpk9Mf1yOlpnUv3MQnMSaOuMl76W63o2yl5tzws96enY1QrngLYg5hCY71ISOlXt gL1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=hxpiq/oPG0DrjrL9Iy8eqnGAwCpvv0aB6eGBgw7h0nA=; b=ehoBelb7c4Zz0pZVLFJ5X9+egxaOf1Ch9osvyzzeO+H/Op4Qrp3JD10bRUOa9cd+HG /Ri4rLmBm9Wqo2zkkrvNHCZ4eMstbag/RC+PXiKWqeEmfeqcJ+GE0CK+TOTntqdVCd3U CHE+JGcXvo9HZfLIEuZ7DnNjb3Le7ZyHY890kEaO0z4TMFoZurfgS5ClS+XE+mYG5jJs 6989MzuzAsVTBaSXAHPzjiRjCeqIPadQeepKil469Du71f145cVL31iO38APMtHv+gEs cX5kGTe+81meC7ocaYuFX7u1WXgoZQT7+cqCofA7oc1GeiDnVoBT4m7sAVysD/cgmzRe SP4w== X-Gm-Message-State: ABUngvdYzto+PVSSh4dARTeRINMFoJN5CYhNvQMwbb6ADbN5MjHqkLmgFFBT+ZrzEI8vUQ== X-Received: by 10.98.198.207 with SMTP id x76mr6799312pfk.33.1479413368045; Thu, 17 Nov 2016 12:09:28 -0800 (PST) Received: from rleblanc-pc ([2604:ba00:2:1:fc51:ef9:d51:50d]) by smtp.gmail.com with ESMTPSA id q27sm10240999pfd.49.2016.11.17.12.09.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Nov 2016 12:09:27 -0800 (PST) Received: from rleblanc by rleblanc-pc with local (Exim 4.87) (envelope-from ) id 1c7Szu-0004mo-KN; Thu, 17 Nov 2016 13:09:26 -0700 From: Robert LeBlanc To: robert@leblancnet.us, grub-devel@gnu.org Subject: [PATCH] disk/mdraid1x: Fix >2TB RAID detection with BIOS Date: Thu, 17 Nov 2016 13:09:07 -0700 Message-Id: <20161117200907.18342-1-robert@leblancnet.us> X-Mailer: git-send-email 2.10.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::244 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 20:09:31 -0000 When a mdadm RAID array is on a drive larger than 2TB, the array is not able to be detected and as such even if the array has a partition that holds /boot under the 2TB limit, it is unable to boot the machine. This is caused by metadata 1.0 being tested first which allocates the superblock at the end of the device. When it tries to access the end of the device it throws an error and the code returns without trying to find the superblock at other locations (metadata 1.1 and 1.2). This patch changes the error to not be fatal and allow for the checking for the other metadata versions and allowing the machine to boot as long as /boot is under the 2TB BIOS limit. This won't cause issues with 1.0 metadata because GRUB is able to read the partitions from the front of the drive/partition without having to determine the data offset, since the data for metadata 1.0 starts at sector 0. Signed-off-by: Robert LeBlanc --- grub-core/disk/mdraid1x_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/disk/mdraid1x_linux.c b/grub-core/disk/mdraid1x_linux.c index 7cc80d3..cc7350c 100644 --- a/grub-core/disk/mdraid1x_linux.c +++ b/grub-core/disk/mdraid1x_linux.c @@ -148,7 +148,7 @@ grub_mdraid_detect (grub_disk_t disk, if (grub_disk_read (disk, sector, 0, sizeof (struct grub_raid_super_1x), &sb)) - return NULL; + continue; if (sb.magic != grub_cpu_to_le32_compile_time (SB_MAGIC) || grub_le_to_cpu64 (sb.super_offset) != sector) -- 2.10.1