From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=17.151.62.27; helo=mail-in5.apple.com; envelope-from=afish@apple.com; receiver=edk2-devel@lists.01.org Received: from mail-in5.apple.com (mail-out5.apple.com [17.151.62.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B7C1F210BFF7C for ; Tue, 3 Jul 2018 13:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1530649808; x=2394563408; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-version:Content-type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-reply-to:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aDNGnMYgeUry1kSHkO34zFJyrAGRIlKiUkoZQi8EQ8I=; b=DdYoXERG7eGbieb4hjgZtu9518R6VkwNqfSfn3BXziS46AdJaU7xdg/AdXAubw8a UJvZymLfUU7Uw82bAWSTaUXzXt6iFKvAWcAYKPHTTLnnZItU1WzeXVO21aEzDMl7 7tUoiUUWVkaLHVqK5KMHmChDqj5T9GcWo/SJnBx1vDFIrkrLS5tGjtU2tW7UtJ+c Sh7lBCLeAnIe9yFSSNZbnQ5fI98lIXtXSbXok4dvuPMRdK6ALyiKQepuEk9Con2c 2HODZwzBMZ8OmYuoJc/Sfp+9ko/U7E04MkZv61JbsUe6GryJSrliCCqA5tOi3SqI EHGWikaI6qsMSPujlfcqwg==; X-AuditID: 11973e13-62dff7000000242c-9f-5b3bdcd0ecab Received: from mr2-mtap-s03.rno.apple.com (mr2-mtap-s03.rno.apple.com [17.179.226.135]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail-in5.apple.com (Apple Secure Mail Relay) with SMTP id 81.7B.09260.0DCDB3B5; Tue, 3 Jul 2018 13:30:08 -0700 (PDT) MIME-version: 1.0 Received: from ma1-mmpp-sz08.apple.com (ma1-mmpp-sz08.apple.com [17.171.128.176]) by mr2-mtap-s03.rno.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) with ESMTPS id <0PBB006N44Y7O0C0@mr2-mtap-s03.rno.apple.com>; Tue, 03 Jul 2018 13:30:08 -0700 (PDT) Received: from process_viserion-daemon.ma1-mmpp-sz08.apple.com by ma1-mmpp-sz08.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) id <0PBB00B004AI6Z00@ma1-mmpp-sz08.apple.com>; Tue, 03 Jul 2018 13:30:07 -0700 (PDT) X-V-A: X-V-T-CD: b98901bc34f291218a59ee0981d2c96a X-V-E-CD: e705ac4f7872cf2f0189df5465f5f0f8 X-V-R-CD: 3d91e738115fc80121c56083fdaeea0c X-V-CD: 0 X-V-ID: 5edf8529-a9fc-41c2-8beb-93932dac6c57 Received: from process_milters-daemon.ma1-mmpp-sz08.apple.com by ma1-mmpp-sz08.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) id <0PBB00A004672100@ma1-mmpp-sz08.apple.com>; Tue, 03 Jul 2018 13:30:00 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-03_08:,, signatures=0 X-Proofpoint-Scanner-Instance: ma-grpmailp-qapp21.corp.apple.com-10000_instance1 Received: from [17.234.149.33] (unknown [17.234.149.33]) by ma1-mmpp-sz08.apple.com (Oracle Communications Messaging Server 8.0.2.3.20180614 64bit (built Jun 14 2018)) with ESMTPSA id <0PBB00FQL4XXNM00@ma1-mmpp-sz08.apple.com>; Tue, 03 Jul 2018 13:30:00 -0700 (PDT) Sender: afish@apple.com From: Andrew Fish Message-id: <14936E0D-1287-4716-AC45-5CEDEC774A0F@apple.com> Date: Tue, 03 Jul 2018 13:29:56 -0700 In-reply-to: Cc: "edk2-devel@lists.01.org" To: "Robinson, Herbie" References: X-Mailer: Apple Mail (2.3445.6.18) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUiuPlRu+6FO9bRBvMuiFrsOXSU2aJp/TZG ByaP7tn/WDxWL7YLYIrisklJzcksSy3St0vgyrjXspi9oO02Y8XKz0fYGhgv72XsYuTkkBAw kTixqgfI5uIQEjjAJDF1xSZmkASvgKDEj8n3WEBsZoEwiY6vv1ggitYzSWydcRnK6WKSeLH9 KyvEKDaJ9SeWMHUxcgDZWhLXuxUhwloS25/9YYSxN07dwwZhc0qc/zKRHcLWkdj94AobxMxO Jokjmy5BJbIltuy8yAJhB0g8enQUrFlIYCKTxOpmWRBbWEBc4t0ZiKvZBJQlVsz/wA7xgY3E 4jmLWCFqDCSWLtwNZrMIqEosndoHNodTIFbi/oPpUF+aS8y48IUJxBYBBsv+y2vZQX4REoiR 2NmUD3GCksT/XUeYJzBKzUIKo1lIYQRha0l8f9QKZHMA2fISB8/LQoQ1JZ7d+8QOYWtLPHl3 gXUBI9sqRqHcxMwc3cw8U73EgoKcVL3k/NxNjKBYnm4nvIPx9CqrQ4wCHIxKPLwrSq2jhVgT y4orcw8xSnOwKInzmiWZRgsJpCeWpGanphakFsUXleakFh9iZOLglGpgbDV9m71XSutG0uEg FTmvefdKJ662vSpnsPpfhdh3rpxry4tm/eT3WCDe47okq77xwN35r3L4S01/35wtrBmzo0ox LcJkackn47PfqksiA6JF3zziinty7LKKybXcTVJailm/GN6/i/12pFl/X7FlltTkhd51ao/U 519MVrb4+yDqmLHmlgO2SizFGYmGWsxFxYkA9X+S0MYCAAA= X-Content-Filtered-By: Mailman/MimeDel 2.1.26 Subject: Re: GPT Partitions on RAID Disks X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 20:30:08 -0000 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT > On Jul 3, 2018, at 10:12 AM, Robinson, Herbie wrote: > > Background: > > I have been tasked with implementing UEFI boot in our VOS operating system. We've been using GPT partitions for more than 15 years, but only within our own OS... We haven't had to interact with any other software before this. We have a fault tolerant OS; so, all disks are RAID1 (software supported). We don't expose the GPT partitioning to our user interface: We have just use it as a wrapper for boot support to keep BIOS from being confused. The intent was to set it up to boot with either the legacy BIOS or UEFI. At the time, we only had a legacy BIOS to test with; so, we never finished the UEFI boot. > > I've reviewed our current implementation and found a few minor things wrong; so, I have been working on a utility to fix them. But the might be some more issues. I have three questions, but relating to RAID 1. > > > 1. We have historically paired entire disks when we do RAID1, not partitions (we have never supported multiple file system partitions on one disk, because it didn't make sense from a performance standpoint). I believe the current initialization uses the same DiskGUID in the GPT header for both disks. I'm assuming that is not going to work properly. Is that correct? > Herbie, I'm not sure that a unique DiskGUID is required for RAID1 given the disks are mirrors. I think the ask is that each unique GPT (some software has to create it) always gets a new GUID/UUID. > 2. The spec also seems to say that the UniquePartitionGUID should also be different for RAID 1 pairs. Is that correct? > Same as DiskGUID is it a true mirror or unique disk? In a practical sense if some one could bit copy a disk you could have duplicates. The hope is that any software that is GPT aware would fix up the Unique GUID/UUID values as part of the cloning operation. > 3. We have learned over the years that one doesn't allocate an entire disk for a RAID (because one may have to replace a drive and replacement may not come with exactly the same ending LBA). We are currently leaving off some space at the end. When we do that, we are not putting the backup GPT header at the last LBA the devices. By my reading of the spec, that is a mistake. I do believe the spec allows me to leave a large gap between the LastUsableLBA in the backup GPT header with the backup table placed anywhere within that gap. Is that correct? > There has been language added over the years to try to help people deal with issues like this. The ATA8-ACS language and this section: "To avoid the need to determine the physical block size and the optimal transfer length granularity, software may align GPT partitions at significantly larger boundaries. For example, assuming logical block 0 is aligned, it may use LBAs that are multiples of 2,048 to align to 1,048,576 byte (1 MiB) boundaries, which supports most common physical block sizes and RAID stripe sizes." I think the "software may align GPT partitions at significantly larger boundaries." in the section above grants you a lot of latitude about how you layout the disks. Caveat Emptor if you need to be interoperable with other chunks of software as there can be extra non-spec assumptions that leak into implementations. The last one that I got hit by was most of the EFI code in the world require a protective MBR, but the spec uses may (not required) when talking about if a protective MBR is required. https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c#L265 // // Verify that the Protective MBR is valid // for (Index = 0; Index < MAX_MBR_PARTITIONS; Index++) { if (ProtectiveMbr->Partition[Index].BootIndicator == 0x00 && ProtectiveMbr->Partition[Index].OSIndicator == PMBR_GPT_PARTITION && UNPACK_UINT32 (ProtectiveMbr->Partition[Index].StartingLBA) == 1 ) { break; } } if (Index == MAX_MBR_PARTITIONS) { goto Done; } Thanks, Andrew Fish > Thanks in advance for your guidance. > Herbie Robinson > Software Architect > Stratus Technologies | www.stratus.com > 5 Mill and Main Place, Suite 500 | Maynard, MA 01754 > T: +1-978-461-7531 | E: Herbie.Robinson@stratus.com > [Stratus Technologies] > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel