Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758954AbcJRJ4t (ORCPT ); Tue, 18 Oct 2016 05:56:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54976 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752265AbcJRJ4j (ORCPT ); Tue, 18 Oct 2016 05:56:39 -0400 Date: Tue, 18 Oct 2016 11:56:37 +0200 From: Karel Zak To: Hannes Reinecke Cc: Davidlohr Bueso , Jens@suse.de, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Hannes Reinecke Subject: Re: [PATCH] partitions/efi: Ignore errors when alternate GPT is not at the end of disk Message-ID: <20161018095637.tgdjehscttskqz5q@ws.net.home> References: <1476699630-127009-1-git-send-email-hare@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476699630-127009-1-git-send-email-hare@suse.de> User-Agent: NeoMutt/20161003 (1.7.0) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 18 Oct 2016 09:56:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1373 Lines: 35 On Mon, Oct 17, 2016 at 12:20:30PM +0200, Hannes Reinecke wrote: > The GPT specification requires that the alternate GPT is at the > end of the disk. However, if a Software RAID1 is enabled the RAID > metadata typically placed at the end of the disk, and the actual > size of the disk is decreased by the size of the metadata. This is not about GPT, but about kernel. It does not support this use-case and it parses PT on wrong device. If I good remember udev should be smart enough to remove (by partx) such partitions and re-create on /dev/mdX. The real solution is to use RAID1 signatures on the begin of the disk. This problem is generic, not specific to GPT. > Plus it's perfectly legit to have a partition table which is > _smaller_ than the device Well, this is reason why GPT differentiate between headers position and usable area (addressed by {First,Last}UsableLba within the header. > eg we don't check for the device > size in the msdos partition, neither. All the "backup" GPT stuff is based on well known place for the backup header. How do you want to reliably support GPT recovery from the backup header if there is no explicit place for the header? Let's imagine your primary header is broken and alternate_lba is unreliable (or zero, etc.), where is the backup header? Karel -- Karel Zak http://karelzak.blogspot.com